Package org.apache.sysds.runtime.io.cog
Class COGByteReader
- java.lang.Object
-
- org.apache.sysds.runtime.io.cog.COGByteReader
-
public class COGByteReader extends Object
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 Constructor Description COGByteReader(BufferedInputStream bis)
COGByteReader(BufferedInputStream bis, int totalBytesRead)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getTotalBytesRead()
void
mark(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.void
reset()
Offers the same functionality as BufferedInputStream.reset.void
setTotalBytesRead(int totalBytesRead)
void
skipBytes(long n)
Skips a given number of bytes without reading them.
-
-
-
Constructor Detail
-
COGByteReader
public COGByteReader(BufferedInputStream bis)
-
COGByteReader
public COGByteReader(BufferedInputStream bis, int totalBytesRead)
-
-
Method Detail
-
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
public void reset() throws DMLRuntimeException
Offers the same functionality as BufferedInputStream.reset. Resets the stream to the last marked position.- Throws:
DMLRuntimeException
- ???
-
skipBytes
public void skipBytes(long n) throws DMLRuntimeException
Skips a given number of bytes without reading them. Useful for jumping to specific offsets- Parameters:
n
- Number of bytes to skip- Throws:
DMLRuntimeException
- ???
-
-