Package io.grpc.servlet
Class ServletServerStream.ByteArrayWritableBuffer
- java.lang.Object
-
- io.grpc.servlet.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 intreadableBytes()Returns the number of bytes one can read from the buffer.voidrelease()Releases the buffer, indicating to theWritableBufferAllocatorthat this buffer is no longer used and its resources can be reused.intwritableBytes()Returns the number of bytes one can write to the buffer.voidwrite(byte b)Appends a single byte to the buffer.voidwrite(byte[] src, int srcIndex, int length)Appendslengthbytes 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:WritableBufferAppendslengthbytes to the buffer from the source array starting atsrcIndex.- Specified by:
writein interfaceWritableBuffer
-
write
public void write(byte b)
Description copied from interface:WritableBufferAppends a single byte to the buffer. This is slow so don't call it.- Specified by:
writein interfaceWritableBuffer
-
writableBytes
public int writableBytes()
Description copied from interface:WritableBufferReturns the number of bytes one can write to the buffer.- Specified by:
writableBytesin interfaceWritableBuffer
-
readableBytes
public int readableBytes()
Description copied from interface:WritableBufferReturns the number of bytes one can read from the buffer.- Specified by:
readableBytesin interfaceWritableBuffer
-
release
public void release()
Description copied from interface:WritableBufferReleases the buffer, indicating to theWritableBufferAllocatorthat this buffer is no longer used and its resources can be reused.- Specified by:
releasein interfaceWritableBuffer
-
-