Package net.schmizz.sshj.common
Class CircularBuffer<T extends CircularBuffer<T>>
- java.lang.Object
-
- net.schmizz.sshj.common.CircularBuffer<T>
-
- Direct Known Subclasses:
CircularBuffer.PlainCircularBuffer
public class CircularBuffer<T extends CircularBuffer<T>> extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCircularBuffer.CircularBufferExceptionstatic classCircularBuffer.PlainCircularBuffer
-
Constructor Summary
Constructors Constructor Description CircularBuffer(int size, int maxSize)Creates a new circular buffer of the given size.
-
Method Summary
Modifier and Type Method Description intavailable()Data available in the buffer for reading.intmaxPossibleRemainingCapacity()Returns how many more bytes this buffer can receive.TputRawBytes(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.java.lang.StringtoString()
-
-
-
Method Detail
-
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.CircularBufferExceptionReads 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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-