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

## org.codehaus.activemq.message.util
Class WireByteArrayOutputStream

    java.lang.Object
      java.io.OutputStream
          java.io.ByteArrayOutputStream
              org.codehaus.activemq.message.util.WireByteArrayOutputStream

public class WireByteArrayOutputStream
extends ByteArrayOutputStream

Optimized ByteArrayOutputStream

Version:
  $Revision: 1.2 $

Field Summary

Fields inherited from class java.io.ByteArrayOutputStream
`buf, count`

Constructor Summary
`WireByteArrayOutputStream()` Creates a new byte array output stream.
`WireByteArrayOutputStream(int size)` Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.

Method Summary
`byte[]` | `getData()`
`void` | `reset()` reset the output stream
`void` | `restart()` start using a fresh byte array
`void` | `restart(int size)` start using a fresh byte array
`void` | `write(byte[] b, int off, int len)` Writes `len` bytes from the specified byte array starting at offset `off` to this byte array output stream.
`void` | `write(int b)` Writes the specified byte to this byte array output stream.

Methods inherited from class java.io.ByteArrayOutputStream
`close, size, toByteArray, toString, toString, toString, writeTo`

Methods inherited from class java.io.OutputStream
`flush, write`

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

Constructor Detail

### WireByteArrayOutputStream

    public WireByteArrayOutputStream()

  Creates a new byte array output stream. The buffer capacity is initially 32 bytes, though its size increases if necessary.

### WireByteArrayOutputStream

    public WireByteArrayOutputStream(int size)

  Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.

Parameters:
  `size` - the initial size.
Throws:
  `IllegalArgumentException` - if size is negative.

Method Detail

### restart

    public void restart(int size)

  start using a fresh byte array

  Parameters:
    `size` -

### restart

    public void restart()

  start using a fresh byte array

### write

    public void write(int b)

  Writes the specified byte to this byte array output stream.

  Parameters:
    `b` - the byte to be written.

### write

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

  Writes `len` bytes from the specified byte array starting at offset `off` to this byte array output stream.

  Parameters:
    `b` - the data.
    `off` - the start offset in the data.
    `len` - the number of bytes to write.

### getData

    public byte[] getData()

  Returns:
    the underlying byte[] buffer

### reset

    public void reset()

  reset the output stream

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

Copyright © 2004 Protique, Ltd.. All Rights Reserved.