Class MetadataExtractor.SequentialByteArrayReader

    • Field Detail

      • _bytes

        private final byte[] _bytes
      • _index

        private int _index
    • Constructor Detail

      • SequentialByteArrayReader

        public SequentialByteArrayReader​(byte[] bytes)
      • SequentialByteArrayReader

        public SequentialByteArrayReader​(byte[] bytes,
                                         int baseIndex)
    • Method Detail

      • getBytes

        public byte[] getBytes​(int count)
                        throws java.io.IOException
        Description copied from class: MetadataExtractor.SequentialReader
        Returns the required number of bytes from the sequence.
        Specified by:
        getBytes in class MetadataExtractor.SequentialReader
        Parameters:
        count - The number of bytes to be returned
        Returns:
        The requested bytes
        Throws:
        java.io.IOException
      • getBytes

        public void getBytes​(byte[] buffer,
                             int offset,
                             int count)
                      throws java.io.IOException
        Description copied from class: MetadataExtractor.SequentialReader
        Retrieves bytes, writing them into a caller-provided buffer.
        Specified by:
        getBytes in class MetadataExtractor.SequentialReader
        Parameters:
        buffer - The array to write bytes to.
        offset - The starting position within buffer to write to.
        count - The number of bytes to be written.
        Throws:
        java.io.IOException
      • skip

        public void skip​(long n)
                  throws java.io.IOException
        Description copied from class: MetadataExtractor.SequentialReader
        Skips forward in the sequence. If the sequence ends, an EOFException is thrown.
        Specified by:
        skip in class MetadataExtractor.SequentialReader
        Parameters:
        n - the number of byte to skip. Must be zero or greater.
        Throws:
        java.io.EOFException - the end of the sequence is reached.
        java.io.IOException - an error occurred reading from the underlying source.
      • trySkip

        public boolean trySkip​(long n)
                        throws java.io.IOException
        Description copied from class: MetadataExtractor.SequentialReader
        Skips forward in the sequence, returning a boolean indicating whether the skip succeeded, or whether the sequence ended.
        Specified by:
        trySkip in class MetadataExtractor.SequentialReader
        Parameters:
        n - the number of byte to skip. Must be zero or greater.
        Returns:
        a boolean indicating whether the skip succeeded, or whether the sequence ended.
        Throws:
        java.io.IOException - an error occurred reading from the underlying source.