net.dontdrinkandroot.utils.lang

## Class FastByteArrayInputStream

- java.lang.Object
- - java.io.InputStream
  - - net.dontdrinkandroot.utils.lang.FastByteArrayInputStream

All Implemented Interfaces:
  Closeable, AutoCloseable

    public class FastByteArrayInputStream
    extends InputStream

ByteArrayInputStream implementation that does not synchronize methods. Source: http://javatechniques.com/blog/faster-deep-copies-of-java-objects/

### Field Summary

Fields
`protected byte[]` `buf` Our byte buffer
`protected int` `count` Number of bytes that we can read from the buffer
`protected int` `pos` Number of bytes that have been read from the buffer

### Constructor Summary

Constructors
Constructor and Description
`FastByteArrayInputStream(byte[] buf, int count)`

### Method Summary

Methods
`int` `available()`
`int` `read()`
`int` `read(byte[] b, int off, int len)`
`long` `skip(long n)`

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

`close, mark, markSupported, read, reset`

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

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

### Field Detail

#### buf

    protected byte[] buf

Our byte buffer

#### count

    protected int count

Number of bytes that we can read from the buffer

#### pos

    protected int pos

Number of bytes that have been read from the buffer

### Constructor Detail

#### FastByteArrayInputStream

    public FastByteArrayInputStream(byte[] buf,
                            int count)

### Method Detail

#### available

    public final int available()

Overrides:
  `available` in class `InputStream`

#### read

    public final int read()

Specified by:
  `read` in class `InputStream`

#### read

    public final int read(byte[] b,
           int off,
           int len)

Overrides:
  `read` in class `InputStream`

#### skip

    public final long skip(long n)

Overrides:
  `skip` in class `InputStream`