Class ExtendedDataInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.DataInput, java.lang.AutoCloseable

    public class ExtendedDataInputStream
    extends java.io.DataInputStream
    An extension of the DataInputStream providing more operations.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExtendedDataInputStream​(java.io.InputStream in)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int readUnsigned3ByteInt()
      Read an unsigned integer from the contained input stream.
      long readUnsignedInt()
      Read an unsigned integer from the contained input stream.
      void skipFully​(long n)
      Skips over and discards n bytes of data from the input stream.
      • Methods inherited from class java.io.DataInputStream

        read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
      • Methods inherited from class java.io.FilterInputStream

        available, close, mark, markSupported, read, reset, skip
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExtendedDataInputStream

        public ExtendedDataInputStream​(java.io.InputStream in)
        Constructor.
        Parameters:
        in - the stream to wrap
    • Method Detail

      • readUnsignedInt

        public long readUnsignedInt()
                             throws java.io.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:
        java.io.IOException - if an I/O error occurs
        java.io.EOFException - if this input stream reaches the end before reading four bytes
      • readUnsigned3ByteInt

        public int readUnsigned3ByteInt()
                                 throws java.io.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:
        java.io.IOException - if an I/O error occurs
        java.io.EOFException - if this input stream reaches the end before reading three bytes
      • skipFully

        public void skipFully​(long n)
                       throws java.io.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:
        java.io.IOException - if an I/O error occurs
        java.io.EOFException - if this input stream reaches the end before skipping the given number of bytes