Package org.apache.solr.common.util

## Class BytesOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - org.apache.solr.common.util.BytesOutputStream

All Implemented Interfaces:
  `Closeable`, `Flushable`, `AutoCloseable`

    public class BytesOutputStream
    extends OutputStream

### Nested Class Summary

Nested Classes
`static class` `BytesOutputStream.Bytes`

### Field Summary

Fields
`protected byte[]` `buf`
`protected int` `sz`

### Constructor Summary

Constructors
`BytesOutputStream()`
`BytesOutputStream​(int size)`

### Method Summary

All Methods Instance Methods Concrete Methods
`BytesOutputStream.Bytes` `bytes()`
`void` `close()`
`InputStream` `inputStream()`
`void` `reset()`
`int` `size()`
`byte[]` `toBytes()`
`String` `toString​(String charset)`
`void` `write​(byte[] b, int off, int len)`
`void` `write​(int b)` Write a byte to the stream.
`void` `writeBytes​(byte[] b)`

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

`flush, nullOutputStream, write`

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

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

### Field Detail

#### buf

    protected byte[] buf

#### sz

    protected int sz

### Constructor Detail

#### BytesOutputStream

    public BytesOutputStream()

#### BytesOutputStream

    public BytesOutputStream​(int size)

### Method Detail

#### toBytes

    public byte[] toBytes()

#### bytes

    public BytesOutputStream.Bytes bytes()

#### inputStream

    public InputStream inputStream()

#### write

    public void write​(int b)

Write a byte to the stream.

Specified by:
  `write` in class `OutputStream`

#### write

    public void write​(byte[] b,
                      int off,
                      int len)

Overrides:
  `write` in class `OutputStream`

#### writeBytes

    public void writeBytes​(byte[] b)

#### reset

    public void reset()

#### size

    public int size()

#### toString

    public String toString​(String charset)

#### close

    public void close()

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `OutputStream`