Package org.apache.sysds.runtime.io.cog
Class COGByteReader
java.lang.Object
org.apache.sysds.runtime.io.cog.COGByteReader
This class is used by the COGReader to read bytes from a BufferedInputStream.
It is wrapper that keeps track of the bytes read and can therefore be used to
easily go to specific offsets.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongvoidmark(long readlimit) Offers the same functionality as BufferedInputStream.mark.byte[]readBytes(int length) Reads a given number of bytes from the BufferedInputStream.byte[]readBytes(long length) Reads a given number of bytes from the BufferedInputStream.voidreset()Offers the same functionality as BufferedInputStream.reset.voidsetTotalBytesRead(int totalBytesRead) voidskipBytes(long n) Skips a given number of bytes without reading them.
-
Constructor Details
-
COGByteReader
-
COGByteReader
-
-
Method Details
-
getTotalBytesRead
public long getTotalBytesRead() -
setTotalBytesRead
public void setTotalBytesRead(int totalBytesRead) -
readBytes
public byte[] readBytes(int length) Reads a given number of bytes from the BufferedInputStream. Increments the totalBytesRead counter by the number of bytes read.- Parameters:
length- ???- Returns:
- ???
-
readBytes
public byte[] readBytes(long length) Reads a given number of bytes from the BufferedInputStream. Increments the totalBytesRead counter by the number of bytes read.- Parameters:
length- ???- Returns:
- ???
-
mark
public void mark(long readlimit) Offers the same functionality as BufferedInputStream.mark. Allows for returning to a previous point if the readlimit is not exceeded.- Parameters:
readlimit- ???
-
reset
Offers the same functionality as BufferedInputStream.reset. Resets the stream to the last marked position.- Throws:
DMLRuntimeException- ???
-
skipBytes
Skips a given number of bytes without reading them. Useful for jumping to specific offsets- Parameters:
n- Number of bytes to skip- Throws:
DMLRuntimeException- ???
-