Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.crypto.core
Class CoderOutputStream

`java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
oracle.security.crypto.core.CoderOutputStream`

public class CoderOutputStream
extends java.io.FilterOutputStream

An output stream that encodes or decodes data passing through it.

To specify the Coder object that is used by the output stream to encode or decode the data, use the setCoder() method.

After filling a buffer of block size, the Coder object is used to encode or decode the buffer. The setMode() method is used to specify encoding or decoding mode (the default mode is encode.)

An IOException is thrown if there is not enough data to fill the buffer.

Field Summary
`protected byte[]` | `buf` The buffer which stores the data.
`protected Coder` | `coder` The Coder used by this stream.
`protected int` | `count` The number of bytes in the buffer.
`static int` | `DECODE_MODE`
`static int` | `ENCODE_MODE`
`protected int` | `mode` The current mode.

Fields inherited from class java.io.FilterOutputStream
`out`

Constructor Summary
`CoderOutputStream(java.io.OutputStream os, Coder c)` Create a new CoderOutputStream with the buffer size equal to the Coder block size.

Method Summary
`void` | `flush()` Flushes the stream, by writing any buffered output bytes.
`Coder` | `getCoder()` Get the Coder used in this stream.
`int` | `getMode()` Get the current mode.
`void` | `setMode(int m)` Set the mode of the stream.
`void` | `write(byte[] b, int off, int len)` Write a sub array of bytes.
`void` | `write(int b)` Write one byte of data.

Methods inherited from class java.io.FilterOutputStream
`close, write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DECODE_MODE

    public static final int DECODE_MODE

  See Also:
    Constant Field Values

### ENCODE_MODE

    public static final int ENCODE_MODE

  See Also:
    Constant Field Values

### mode

    protected int mode

  The current mode.

### coder

    protected Coder coder

  The Coder used by this stream.

### buf

    protected byte[] buf

  The buffer which stores the data.

### count

    protected int count

  The number of bytes in the buffer.

Constructor Detail

### CoderOutputStream

    public CoderOutputStream(java.io.OutputStream os,
                             Coder c)

  Create a new CoderOutputStream with the buffer size equal to the Coder block size.

Method Detail

### getCoder

    public Coder getCoder()

  Get the Coder used in this stream.

### getMode

    public int getMode()

  Get the current mode.

### setMode

    public void setMode(int m)

  Set the mode of the stream.

### write

    public void write(int b)
               throws java.io.IOException

  Write one byte of data. Blocks until byte is actually written.
  Throws:
    `java.io.IOException`

### write

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

  Write a sub array of bytes.
  Parameters:
    `b` - the data to be written
    `off` - start offset of data
    `len` - number of bytes to write
  Throws:
    `java.io.IOException`

### flush

    public void flush()
               throws java.io.IOException

  Flushes the stream, by writing any buffered output bytes.
  Throws:
    `java.io.IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005, 2006 , Oracle. All rights reserved.