uk.ac.starlink.util

## Class DataBufferedInputStream

- java.lang.Object
- - java.io.InputStream
  - - java.io.FilterInputStream
    - - uk.ac.starlink.util.DataBufferedInputStream

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

      public class DataBufferedInputStream
      extends java.io.FilterInputStream
      implements java.io.DataInput

  InputStream which provides buffering and an efficient DataInput implementation. It can be much more efficient than layering a DataInputStream on top of a BufferedInputStream.
  Since:
    1 Mar 2022

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_BUFFER_SIZE` Default buffer size 8192, same as java.io.BufferedInputStream.

    - ### Fields inherited from class java.io.FilterInputStream

      `in`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataBufferedInputStream(java.io.InputStream in)` Constructs an instance with a default buffer size.
    `DataBufferedInputStream(java.io.InputStream in, int size)` Constructs an instance with a given buffer size.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `available()`
    `void` | `mark(int limit)`
    `boolean` | `markSupported()` Returns false;
    `int` | `read()`
    `int` | `read(byte[] b)`
    `int` | `read(byte[] b, int off, int len)`
    `boolean` | `readBoolean()`
    `byte` | `readByte()`
    `char` | `readChar()`
    `double` | `readDouble()`
    `float` | `readFloat()`
    `void` | `readFully(byte[] b)`
    `void` | `readFully(byte[] b, int off, int len)`
    `int` | `readInt()`
    `java.lang.String` | `readLine()` Deprecated.
    `long` | `readLong()`
    `short` | `readShort()`
    `int` | `readUnsignedByte()`
    `int` | `readUnsignedShort()`
    `java.lang.String` | `readUTF()`
    `void` | `reset()`
    `long` | `skip(long n)`
    `int` | `skipBytes(int n)`

    - ### Methods inherited from class java.io.FilterInputStream

      `close`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_BUFFER_SIZE

          public static final int DEFAULT_BUFFER_SIZE

      Default buffer size 8192, same as java.io.BufferedInputStream.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DataBufferedInputStream

          public DataBufferedInputStream(java.io.InputStream in)

      Constructs an instance with a default buffer size.
      Parameters:
        `in` - base input stream

    - #### DataBufferedInputStream

          public DataBufferedInputStream(java.io.InputStream in,
                                         int size)

      Constructs an instance with a given buffer size.
      Parameters:
        `in` - base input stream
        `size` - buffer length in bytes

  - ### Method Detail

    - #### read

          public int read()
                   throws java.io.IOException

      Overrides:
        `read` in class `java.io.FilterInputStream`
      Throws:
        `java.io.IOException`

    - #### read

          public int read(byte[] b,
                          int off,
                          int len)
                   throws java.io.IOException

      Overrides:
        `read` in class `java.io.FilterInputStream`
      Throws:
        `java.io.IOException`

    - #### read

          public int read(byte[] b)
                   throws java.io.IOException

      Overrides:
        `read` in class `java.io.FilterInputStream`
      Throws:
        `java.io.IOException`

    - #### skip

          public long skip(long n)
                    throws java.io.IOException

      Overrides:
        `skip` in class `java.io.FilterInputStream`
      Throws:
        `java.io.IOException`

    - #### available

          public int available()
                        throws java.io.IOException

      Overrides:
        `available` in class `java.io.FilterInputStream`
      Throws:
        `java.io.IOException`

    - #### markSupported

          public boolean markSupported()

      Returns false;
      Overrides:
        `markSupported` in class `java.io.FilterInputStream`

    - #### mark

          public void mark(int limit)

      Overrides:
        `mark` in class `java.io.FilterInputStream`

    - #### reset

          public void reset()
                     throws java.io.IOException

      Overrides:
        `reset` in class `java.io.FilterInputStream`
      Throws:
        `java.io.IOException`

    - #### readBoolean

          public boolean readBoolean()
                              throws java.io.IOException

      Specified by:
        `readBoolean` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readByte

          public byte readByte()
                        throws java.io.IOException

      Specified by:
        `readByte` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readUnsignedByte

          public int readUnsignedByte()
                               throws java.io.IOException

      Specified by:
        `readUnsignedByte` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readShort

          public short readShort()
                          throws java.io.IOException

      Specified by:
        `readShort` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readUnsignedShort

          public int readUnsignedShort()
                                throws java.io.IOException

      Specified by:
        `readUnsignedShort` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readChar

          public char readChar()
                        throws java.io.IOException

      Specified by:
        `readChar` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readInt

          public int readInt()
                      throws java.io.IOException

      Specified by:
        `readInt` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readLong

          public long readLong()
                        throws java.io.IOException

      Specified by:
        `readLong` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readFloat

          public float readFloat()
                          throws java.io.IOException

      Specified by:
        `readFloat` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readDouble

          public double readDouble()
                            throws java.io.IOException

      Specified by:
        `readDouble` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readFully

          public void readFully(byte[] b)
                         throws java.io.IOException

      Specified by:
        `readFully` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readFully

          public void readFully(byte[] b,
                                int off,
                                int len)
                         throws java.io.IOException

      Specified by:
        `readFully` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### readLine

          @Deprecated
          public java.lang.String readLine()
                                                throws java.io.IOException

      Deprecated.
      This method is deprecated and unsupported.
      Specified by:
        `readLine` in interface `java.io.DataInput`
      Throws:
        `java.lang.UnsupportedOperationException` - always
        `java.io.IOException`

    - #### readUTF

          public java.lang.String readUTF()
                                   throws java.io.IOException

      Specified by:
        `readUTF` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`

    - #### skipBytes

          public int skipBytes(int n)
                        throws java.io.IOException

      Specified by:
        `skipBytes` in interface `java.io.DataInput`
      Throws:
        `java.io.IOException`