Class ChunkedSliceInput

All Implemented Interfaces:
Closeable, DataInput, AutoCloseable

public final class ChunkedSliceInput extends FixedLengthSliceInput
  • Constructor Details

  • Method Details

    • length

      public long length()
      Description copied from class: FixedLengthSliceInput
      Gets the total size of this input stream.
      Specified by:
      length in class FixedLengthSliceInput
    • position

      public long position()
      Description copied from class: SliceInput
      Returns the position of this buffer.
      Specified by:
      position in class SliceInput
    • setPosition

      public void setPosition(long position)
      Description copied from class: SliceInput
      Sets the position of this buffer.
      Specified by:
      setPosition in class SliceInput
    • isReadable

      public boolean isReadable()
      Description copied from class: SliceInput
      Returns true if and only if available() is greater than 0.
      Specified by:
      isReadable in class SliceInput
    • available

      public int available()
      Description copied from class: SliceInput
      Returns the number of bytes that can be read without blocking.
      Specified by:
      available in class SliceInput
    • ensureAvailable

      public void ensureAvailable(int size)
    • readBoolean

      public boolean readBoolean()
      Description copied from class: SliceInput
      Returns true if the byte at the current position is not 0 and increases the position by 1 in this buffer.
      Specified by:
      readBoolean in interface DataInput
      Specified by:
      readBoolean in class SliceInput
    • read

      public int read()
      Specified by:
      read in class SliceInput
    • readByte

      public byte readByte()
      Description copied from class: SliceInput
      Gets a byte at the current position and increases the position by 1 in this buffer.
      Specified by:
      readByte in interface DataInput
      Specified by:
      readByte in class SliceInput
    • readUnsignedByte

      public int readUnsignedByte()
      Description copied from class: SliceInput
      Gets an unsigned byte at the current position and increases the position by 1 in this buffer.
      Specified by:
      readUnsignedByte in interface DataInput
      Specified by:
      readUnsignedByte in class SliceInput
    • readShort

      public short readShort()
      Description copied from class: SliceInput
      Gets a 16-bit short integer at the current position and increases the position by 2 in this buffer.
      Specified by:
      readShort in interface DataInput
      Specified by:
      readShort in class SliceInput
    • readUnsignedShort

      public int readUnsignedShort()
      Description copied from class: SliceInput
      Gets an unsigned 16-bit short integer at the current position and increases the position by 2 in this buffer.
      Specified by:
      readUnsignedShort in interface DataInput
      Specified by:
      readUnsignedShort in class SliceInput
    • readInt

      public int readInt()
      Description copied from class: SliceInput
      Gets a 32-bit integer at the current position and increases the position by 4 in this buffer.
      Specified by:
      readInt in interface DataInput
      Specified by:
      readInt in class SliceInput
    • readLong

      public long readLong()
      Description copied from class: SliceInput
      Gets a 64-bit long at the current position and increases the position by 8 in this buffer.
      Specified by:
      readLong in interface DataInput
      Specified by:
      readLong in class SliceInput
    • readFloat

      public float readFloat()
      Description copied from class: SliceInput
      Gets a 32-bit float at the current position and increases the position by 4 in this buffer.
      Specified by:
      readFloat in interface DataInput
      Specified by:
      readFloat in class SliceInput
    • readDouble

      public double readDouble()
      Description copied from class: SliceInput
      Gets a 64-bit double at the current position and increases the position by 8 in this buffer.
      Specified by:
      readDouble in interface DataInput
      Specified by:
      readDouble in class SliceInput
    • readSlice

      public Slice readSlice(int length)
      Description copied from class: SliceInput
      Returns a new slice of this buffer's sub-region starting at the current position and increases the position by the size of the new slice (= length). The new slice could be either COMPACT or NOT_COMPACT.
      Specified by:
      readSlice in class SliceInput
      Parameters:
      length - the size of the new slice
      Returns:
      the newly created slice
    • readBytes

      public void readBytes(Slice destination, int destinationIndex, int length)
      Description copied from class: SliceInput
      Transfers this buffer's data to the specified destination starting at the current position and increases the position by the number of the transferred bytes (= length).
      Specified by:
      readBytes in class SliceInput
      destinationIndex - the first index of the destination
      length - the number of bytes to transfer
    • read

      public int read(byte[] destination, int destinationIndex, int length)
      Specified by:
      read in class SliceInput
    • readBytes

      public void readBytes(byte[] destination, int destinationIndex, int length)
      Description copied from class: SliceInput
      Transfers this buffer's data to the specified destination starting at the current position and increases the position by the number of the transferred bytes (= length).
      Specified by:
      readBytes in class SliceInput
      destinationIndex - the first index of the destination
      length - the number of bytes to transfer
    • readBytes

      public void readBytes(OutputStream out, int length) throws IOException
      Description copied from class: SliceInput
      Transfers this buffer's data to the specified stream starting at the current position.
      Specified by:
      readBytes in class SliceInput
      length - the number of bytes to transfer
      Throws:
      IOException - if the specified stream threw an exception during I/O
    • skip

      public long skip(long length)
      Specified by:
      skip in class SliceInput
    • skipBytes

      public int skipBytes(int length)
      Specified by:
      skipBytes in interface DataInput
      Specified by:
      skipBytes in class SliceInput
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class SliceInput
    • getRetainedSize

      public long getRetainedSize()
      Description copied from class: SliceInput
      Approximate number of bytes retained by this instance.
      Specified by:
      getRetainedSize in class SliceInput
    • toString

      public String toString()
      Overrides:
      toString in class Object