Package org.mariadb.jdbc.client.socket.impl

## Class ReadAheadBufferedStream

- java.lang.Object
- - java.io.InputStream
  - - java.io.FilterInputStream
    - - org.mariadb.jdbc.client.socket.impl.ReadAheadBufferedStream

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

    public class ReadAheadBufferedStream
    extends FilterInputStream

Permit to buf socket data, reading not only asked bytes, but available number of bytes when possible.

### Field Summary

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

`in`

### Constructor Summary

Constructors
`ReadAheadBufferedStream​(InputStream in)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `available()`
`void` `close()`
`boolean` `markSupported()`
`int` `read()` Reading one byte from cache of socket if needed.
`int` `read​(byte[] externalBuf, int off, int len)` Returing byte array, from cache of reading socket if needed.
`void` `reset()`
`long` `skip​(long n)`

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

`mark, read`

### Methods inherited from class java.io.InputStream

`nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo`

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

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

### Constructor Detail

#### ReadAheadBufferedStream

    public ReadAheadBufferedStream​(InputStream in)

### Method Detail

#### read

    public int read()
             throws IOException

Reading one byte from cache of socket if needed.

Overrides:
  `read` in class `FilterInputStream`
Returns:
  byte value
Throws:
  `IOException` - if socket reading error.

#### read

    public int read​(byte[] externalBuf,
                    int off,
                    int len)
             throws IOException

Returing byte array, from cache of reading socket if needed.

Overrides:
  `read` in class `FilterInputStream`
Parameters:
  `externalBuf` - buf to fill
  `off` - offset
  `len` - length to read
Returns:
  number of added bytes
Throws:
  `IOException` - if exception during socket reading

#### skip

    public long skip​(long n)
              throws IOException

Overrides:
  `skip` in class `FilterInputStream`
Throws:
  `IOException`

#### available

    public int available()
                  throws IOException

Overrides:
  `available` in class `FilterInputStream`
Throws:
  `IOException`

#### reset

    public void reset()
               throws IOException

Overrides:
  `reset` in class `FilterInputStream`
Throws:
  `IOException`

#### markSupported

    public boolean markSupported()

Overrides:
  `markSupported` in class `FilterInputStream`

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `FilterInputStream`
Throws:
  `IOException`