Class CircularBuffer<T extends CircularBuffer<T>>
java.lang.Object
net.schmizz.sshj.common.CircularBuffer<T>
- Direct Known Subclasses:
CircularBuffer.PlainCircularBuffer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final class -
Constructor Summary
ConstructorsConstructorDescriptionCircularBuffer(int size, int maxSize) Creates a new circular buffer of the given size. -
Method Summary
Modifier and TypeMethodDescriptionintData available in the buffer for reading.intReturns how many more bytes this buffer can receive.putRawBytes(byte[] source, int offset, int length) Writes data to this buffer from the provided array.voidreadRawBytes(byte[] destination, int offset, int length) Reads data from this buffer into the provided array.toString()
-
Constructor Details
-
CircularBuffer
public CircularBuffer(int size, int maxSize) Creates a new circular buffer of the given size. The capacity of the buffer is one less than the size/
-
-
Method Details
-
available
public int available()Data available in the buffer for reading. -
maxPossibleRemainingCapacity
public int maxPossibleRemainingCapacity()Returns how many more bytes this buffer can receive. -
readRawBytes
public void readRawBytes(byte[] destination, int offset, int length) throws CircularBuffer.CircularBufferException Reads data from this buffer into the provided array. -
putRawBytes
public T putRawBytes(byte[] source, int offset, int length) throws CircularBuffer.CircularBufferException Writes data to this buffer from the provided array. -
toString
-