# Class: com.pnfsoftware.jeb.util.encoding.Base64.OutputStream

A [Base64.OutputStream](Base64.OutputStream) will write data to another `java.io.OutputStream`, given in the constructor, and encode/decode to/from Base64 notation on the fly.

## Constructor: OutputStream
- parameter: `out`, type: `java.io.OutputStream`

Description: Constructs a [Base64.OutputStream](Base64.OutputStream) in ENCODE mode.
parameter: out: the `java.io.OutputStream` to which data will be written.

## Constructor: OutputStream
- parameter: `out`, type: `java.io.OutputStream`
- parameter: `options`, type: `int`

Description: Constructs a [Base64.OutputStream](Base64.OutputStream) in either ENCODE or DECODE mode. 

 Valid options: 

```

   ENCODE or DECODE: Encode or Decode as data is read.
   DO_BREAK_LINES: don't break lines at 76 characters
     (only meaningful when encoding)
 
```
 

 Example: `new Base64.OutputStream( out, Base64.ENCODE )`
parameter: out: the `java.io.OutputStream` to which data will be written.
parameter: options: Specified options.
see also: Base64#ENCODE
see also: Base64#DECODE
see also: Base64#DO_BREAK_LINES

## Method: close

Description: Flushes and closes \(I think, in the superclass\) the stream.

## Method: flushBase64

Description: Method added by PHIL \[Thanks, PHIL \-Rob\] This pads the buffer without closing the stream.
throws: if there's an error.

## Method: resumeEncoding

Description: Resumes encoding of the stream. May be helpful if you need to embed a piece of base64\-encoded data in a stream.

## Method: suspendEncoding

Description: Suspends encoding of the stream. May be helpful if you need to embed a piece of base64\-encoded data in a stream.
throws: if there's an error flushing

## Method: write
- parameter: `theByte`, type: `int`

Description: Writes the byte to the output stream after converting to/from Base64 notation. When encoding, bytes are buffered three at a time before the output stream actually gets a write\(\) call. When decoding, bytes are buffered four at a time.
parameter: theByte: the byte to write

## Method: write
- parameter: `theBytes`, type: `byte[]`
- parameter: `off`, type: `int`
- parameter: `len`, type: `int`

Description: Calls [#write(int)](#write(int)) repeatedly until *len* bytes are written.
parameter: theBytes: array from which to read bytes
parameter: off: offset for array
parameter: len: max number of bytes to read into array

