Class 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.
    • 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 - ???