Class ExtendedDataInputStream

All Implemented Interfaces:
Closeable, DataInput, AutoCloseable

public class ExtendedDataInputStream extends DataInputStream
An extension of the DataInputStream providing more operations.
  • Constructor Details

    • ExtendedDataInputStream

      public ExtendedDataInputStream(InputStream in)
      Constructor.
      Parameters:
      in - the stream to wrap
  • Method Details

    • readUnsignedInt

      public long readUnsignedInt() throws IOException
      Read an unsigned integer from the contained input stream.
      Returns:
      the next four bytes of this input stream, interpreted as an unsigned 32-bit integer
      Throws:
      IOException - if an I/O error occurs
      EOFException - if this input stream reaches the end before reading four bytes
    • readUnsigned3ByteInt

      public int readUnsigned3ByteInt() throws IOException
      Read an unsigned integer from the contained input stream.
      Returns:
      the next three bytes of this input stream, interpreted as an unsigned 24-bit integer
      Throws:
      IOException - if an I/O error occurs
      EOFException - if this input stream reaches the end before reading three bytes
    • skipFully

      public void skipFully(long n) throws IOException
      Skips over and discards n bytes of data from the input stream. This method attempts to fully skip the number of bytes specified.
      Parameters:
      n - the number of bytes to be skipped
      Throws:
      IOException - if an I/O error occurs
      EOFException - if this input stream reaches the end before skipping the given number of bytes