Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.novell.io
Class Base64OutputStream

    java.lang.Object
      java.io.OutputStream
          com.novell.io.Base64OutputStream

All Implemented Interfaces:
  Closeable, Flushable

    public class Base64OutputStream

extends OutputStream

An extension of java.io.OutputStream that will encode bytes into `char`s using base64 encoding.

See Also:
  `Base64InputStream`

Constructor Summary
`Base64OutputStream(Writer out)` Creates a new Base64OutputStream that will write the encoded data to the passed `Writer`.

Method Summary
`void` | `close()` Closes the stream.
`protected void` | `empty_buffer()` Encode all buffered bytes and write the encoded bytes to the output stream.
`static char[]` | `encode(byte[] data)` Encode an array of `byte`s into an array of `char`s using base64 encoding.
`static char[]` | `encode(byte[] data, boolean wrap)` Encode an array of `byte`s into an array of `char`s using base64 encoding.
`static char[]` | `encode(byte[] data, int off, int len)` Encode an array of `byte`s into an array of `char`s using base64 encoding.
`static char[]` | `encode(byte[] data, int off, int len, boolean wrap)` Encode an array of `byte`s into an array of `char`s using base64 encoding.
`void` | `flush()`
`void` | `write(byte[] b, int off, int len)` Writes a subarray of `byte`s.
`void` | `write(InputStream is)` Writes a inputStream.
`void` | `write(int b)` Writes a `byte`.

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

### Base64OutputStream

    public Base64OutputStream(Writer out)

  Creates a new Base64OutputStream that will write the encoded data to the passed `Writer`.

  Parameters:
    `out` - the `Writer` to which the encoded data will be written.

Method Detail

### write

    public void write(int b)
               throws IOException

  Writes a `byte`. This method will block until the `byte` is actually written.

  Specified by:
    `write` in class `OutputStream`
  Parameters:
    `b` - the `byte`
  Throws:
    `IOException` - If an I/O error has occurred.

### write

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

  Writes a subarray of `byte`s.

  Overrides:
    `write` in class `OutputStream`
  Parameters:
    `b` - the data to be written
    `off` - the start offset in the data
    `len` - the number of bytes to be written
  Throws:
    `IOException` - If an I/O error has occurred.

### write

    public void write(InputStream is)
               throws IOException

  Writes a inputStream.

  Parameters:
    `is` - the inputStream to be written
  Throws:
    `IOException` - If an I/O error has occurred.

### flush

    public void flush()
               throws IOException

  Specified by:
    `flush` in interface `Flushable`
  Overrides:
    `flush` in class `OutputStream`
  Throws:
    `IOException`

### close

    public void close()
               throws IOException

  Closes the stream.

  Specified by:
    `close` in interface `Closeable`
  Overrides:
    `close` in class `OutputStream`
  Throws:
    `IOException` - If an I/O error has occurred.

### empty_buffer

    protected void empty_buffer()
                         throws IOException

  Encode all buffered bytes and write the encoded bytes to the output stream.

  Throws:
    `IOException` - If an I/O error has occurred.

### encode

    public static char[] encode(byte[] data)

  Encode an array of `byte`s into an array of `char`s using base64 encoding.

  Parameters:
    `data` - The bytes to be encoded.
  Returns:
    An array of chars that contain the base64-encoded data.

### encode

    public static char[] encode(byte[] data,
                                boolean wrap)

  Encode an array of `byte`s into an array of `char`s using base64 encoding.

  Parameters:
    `data` - The bytes to be encoded.
    `wrap` - true if should wrap lines
  Returns:
    An array of chars that contain the base64-encoded data.

### encode

    public static char[] encode(byte[] data,
                                int off,
                                int len)

  Encode an array of `byte`s into an array of `char`s using base64 encoding.

  Parameters:
    `data` - The bytes to be encoded.
    `off` - The starting offset in `data`
    `len` - The number of bytes to encode.
  Returns:
    An array of chars that contain the base64-encoded data.

### encode

    public static char[] encode(byte[] data,
                                int off,
                                int len,
                                boolean wrap)

  Encode an array of `byte`s into an array of `char`s using base64 encoding.

  Parameters:
    `data` - The bytes to be encoded.
    `off` - The starting offset in `data`
    `len` - The number of bytes to encode.
    `wrap` - true if should wrap lines
  Returns:
    An array of chars that contain the base64-encoded data.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD