org.neodatis.tool.wrappers.io
Class MultiBufferVO
- java.lang.Object
-
- org.neodatis.tool.wrappers.io.MultiBufferVO
-
public class MultiBufferVO extends java.lang.ObjectA simple class to store bytes
-
-
Field Summary
Fields Modifier and Type Field and Description long[]bufferEndPositionThe current end position of the bufferbyte[][]bufferslong[]bufferStartPositionThe current start position of the bufferint[]maxPositionInBufferThe max position in the buffer, used to optimize the flush - to flush only new data and not all the buffer
-
Constructor Summary
Constructors Constructor and Description MultiBufferVO(int numberOfBuffers, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclear()voidclearBuffer(int bufferIndex)byte[]getBuffer2(int index)intgetBufferIndexForPosition(long position, int size)bytegetByte(int bufferIndex, int byteIndex)longgetCreationDate(int bufferIndex)booleanhasBeenUsedForWrite(int bufferIndex)voidsetByte(int bufferIndex, int positionInBuffer, byte b)voidsetCreationDate(int bufferIndex, long currentTimeInMs)voidsetPositions(int bufferIndex, long startPosition, long endPosition, int maxPosition)voidwriteBytes(int bufferIndex, byte[] bytes, int startIndex, int offsetWhereToCopy, int lengthToCopy)
-
-
-
Field Detail
-
buffers
public byte[][] buffers
-
bufferStartPosition
public long[] bufferStartPosition
The current start position of the buffer
-
bufferEndPosition
public long[] bufferEndPosition
The current end position of the buffer
-
maxPositionInBuffer
public int[] maxPositionInBuffer
The max position in the buffer, used to optimize the flush - to flush only new data and not all the buffer
-
-
Method Detail
-
getBuffer2
public byte[] getBuffer2(int index)
-
getByte
public byte getByte(int bufferIndex, int byteIndex)
-
clearBuffer
public void clearBuffer(int bufferIndex)
- Parameters:
i-
-
setByte
public void setByte(int bufferIndex, int positionInBuffer, byte b)- Parameters:
bufferIndex-positionInBuffer-b-
-
getBufferIndexForPosition
public int getBufferIndexForPosition(long position, int size)
-
setCreationDate
public void setCreationDate(int bufferIndex, long currentTimeInMs)- Parameters:
bufferIndex-currentTimeInMs-
-
setPositions
public void setPositions(int bufferIndex, long startPosition, long endPosition, int maxPosition)- Parameters:
bufferIndex-newPosition-endPosition-i-
-
writeBytes
public void writeBytes(int bufferIndex, byte[] bytes, int startIndex, int offsetWhereToCopy, int lengthToCopy)- Parameters:
bufferIndex-bytes-startIndex-i-lengthToCopy-
-
hasBeenUsedForWrite
public boolean hasBeenUsedForWrite(int bufferIndex)
- Parameters:
bufferIndex-- Returns:
-
clear
public void clear()
-
getCreationDate
public long getCreationDate(int bufferIndex)
- Parameters:
i-- Returns:
-
-
DataMelt 3.0 © DataMelt by jWork.ORG