Package io.grpc.servlet.jakarta
Class ServletServerStream.ByteArrayWritableBuffer
- java.lang.Object
-
- io.grpc.servlet.jakarta.ServletServerStream.ByteArrayWritableBuffer
-
- All Implemented Interfaces:
WritableBuffer
- Enclosing class:
- ServletServerStream
private static final class ServletServerStream.ByteArrayWritableBuffer extends java.lang.Object implements WritableBuffer
-
-
Constructor Summary
Constructors Constructor Description ByteArrayWritableBuffer(int capacityHint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
readableBytes()
Returns the number of bytes one can read from the buffer.void
release()
Releases the buffer, indicating to theWritableBufferAllocator
that this buffer is no longer used and its resources can be reused.int
writableBytes()
Returns the number of bytes one can write to the buffer.void
write(byte b)
Appends a single byte to the buffer.void
write(byte[] src, int srcIndex, int length)
Appendslength
bytes to the buffer from the source array starting atsrcIndex
.
-
-
-
Method Detail
-
write
public void write(byte[] src, int srcIndex, int length)
Description copied from interface:WritableBuffer
Appendslength
bytes to the buffer from the source array starting atsrcIndex
.- Specified by:
write
in interfaceWritableBuffer
-
write
public void write(byte b)
Description copied from interface:WritableBuffer
Appends a single byte to the buffer. This is slow so don't call it.- Specified by:
write
in interfaceWritableBuffer
-
writableBytes
public int writableBytes()
Description copied from interface:WritableBuffer
Returns the number of bytes one can write to the buffer.- Specified by:
writableBytes
in interfaceWritableBuffer
-
readableBytes
public int readableBytes()
Description copied from interface:WritableBuffer
Returns the number of bytes one can read from the buffer.- Specified by:
readableBytes
in interfaceWritableBuffer
-
release
public void release()
Description copied from interface:WritableBuffer
Releases the buffer, indicating to theWritableBufferAllocator
that this buffer is no longer used and its resources can be reused.- Specified by:
release
in interfaceWritableBuffer
-
-