Class BinaryReader

    • Constructor Detail

      • BinaryReader

        private BinaryReader()
        Only allow subclassing for inner classes.
    • Method Detail

      • newInstance

        public static BinaryReader newInstance​(java.nio.ByteBuffer buffer,
                                               boolean bufferIsImmutable)
        Creates a new reader using the given buffer as input.
        Parameters:
        buffer - the input buffer. The buffer (including position, limit, etc.) will not be modified. To increment the buffer position after the read completes, use the value returned by getTotalBytesRead().
        bufferIsImmutable - if true the reader assumes that the content of buffer will never change and any allocated ByteString instances will by directly wrap slices of buffer.
        Returns:
        the reader
      • getTotalBytesRead

        public abstract int getTotalBytesRead()
        Returns the total number of bytes read so far from the input buffer.