org.mariadb.jdbc.internal.stream

## Class OptimizedBufferedInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.mariadb.jdbc.internal.stream.OptimizedBufferedInputStream

All Implemented Interfaces:
  Closeable, AutoCloseable

    public class OptimizedBufferedInputStream
    extends InputStream

### Field Summary

Fields
`protected int` `count`
`protected int` `position`

### Constructor Summary

Constructors
Constructor and Description
`OptimizedBufferedInputStream(InputStream stream)` Optimized bufferedInputStream for inputStream.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `available()`
`void` `close()`
`boolean` `markSupported()`
`int` `read()`
`int` `read(byte[] bytes, int off, int len)`
`long` `skip(long length)`

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

`mark, read, reset`

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

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

### Field Detail

#### count

    protected int count

#### position

    protected int position

### Constructor Detail

#### OptimizedBufferedInputStream

    public OptimizedBufferedInputStream(InputStream stream)

Optimized bufferedInputStream for inputStream. This inputStream is NOT synchronized since locking is done by reentrantLock before that.

Parameters:
  `stream` - underlyingStream

### Method Detail

#### read

    public int read()
             throws IOException

Specified by:
  `read` in class `InputStream`
Throws:
  `IOException`

#### read

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

Overrides:
  `read` in class `InputStream`
Throws:
  `IOException`

#### skip

    public long skip(long length)
              throws IOException

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

#### close

    public void close()
               throws IOException

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

#### markSupported

    public boolean markSupported()

Overrides:
  `markSupported` in class `InputStream`

#### available

    public int available()
                  throws IOException

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