Package com.mku.streams
Class Buffer
java.lang.Object
com.mku.streams.Buffer
Buffer that can be used for buffered streams.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the buffer.longgetCount()Get the data countbyte[]getData()Get the buffer datalongGet the start positionvoidsetCount(long count) Set the data countvoidsetData(byte[] data) Set the datavoidsetStartPos(long startPos) Set the start position
-
Constructor Details
-
Buffer
public Buffer(int bufferSize) Instantiate a buffer.- Parameters:
bufferSize- The buffer size
-
-
Method Details
-
getData
public byte[] getData()Get the buffer data- Returns:
- The buffer data
-
setData
public void setData(byte[] data) Set the data- Parameters:
data- The data
-
getStartPos
public long getStartPos()Get the start position- Returns:
- The start position
-
setStartPos
public void setStartPos(long startPos) Set the start position- Parameters:
startPos- The start position
-
getCount
public long getCount()Get the data count- Returns:
- The data count
-
setCount
public void setCount(long count) Set the data count- Parameters:
count- The data count
-
clear
public void clear()Clear the buffer.
-