com.amazon.redshift.largeobject

## Class BlobOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - com.amazon.redshift.largeobject.BlobOutputStream

All Implemented Interfaces:
  Closeable, Flushable, AutoCloseable

    public class BlobOutputStream
    extends OutputStream

This implements a basic output stream that writes to a LargeObject.

### Constructor Summary

Constructors
Constructor and Description
`BlobOutputStream(LargeObject lo)` Create an OutputStream to a large object.
`BlobOutputStream(LargeObject lo, int bsize)` Create an OutputStream to a large object.

### Method Summary

Methods
`void` `close()`
`void` `flush()` Flushes this output stream and forces any buffered output bytes to be written out.
`void` `write(byte[] buf, int off, int len)`
`void` `write(int b)`

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

`write`

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

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

### Constructor Detail

#### BlobOutputStream

    public BlobOutputStream(LargeObject lo)

Create an OutputStream to a large object.

Parameters:
  `lo` - LargeObject

#### BlobOutputStream

    public BlobOutputStream(LargeObject lo,
                    int bsize)

Create an OutputStream to a large object.

Parameters:
  `lo` - LargeObject
  `bsize` - The size of the buffer used to improve performance

### Method Detail

#### write

    public void write(int b)
               throws IOException

Specified by:
  `write` in class `OutputStream`
Throws:
  `IOException`

#### write

    public void write(byte[] buf,
             int off,
             int len)
               throws IOException

Overrides:
  `write` in class `OutputStream`
Throws:
  `IOException`

#### flush

    public void flush()
               throws IOException

Flushes this output stream and forces any buffered output bytes to be written out. The general contract of `flush` is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.

Specified by:
  `flush` in interface `Flushable`
Overrides:
  `flush` in class `OutputStream`
Throws:
  `IOException` - if an I/O error occurs.

#### close

    public void close()
               throws IOException

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