edu.vt.middleware.crypt.io
Class DirectByteArrayOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.ByteArrayOutputStream
          extended by edu.vt.middleware.crypt.io.DirectByteArrayOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class DirectByteArrayOutputStream
extends ByteArrayOutputStream

Extends ByteArrayOutputStream by allowing direct access to the internal byte buffer.

Version:
$Revision: 2744 $
Author:
Middleware Services

Field Summary
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
DirectByteArrayOutputStream()
          Creates a new instance with a buffer of the default size.
DirectByteArrayOutputStream(int capacity)
          Creates a new instance with a buffer of the given initial capacity.
 
Method Summary
 byte[] getBuffer()
          Gets the internal byte buffer.
 
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, write, write, 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

DirectByteArrayOutputStream

public DirectByteArrayOutputStream()
Creates a new instance with a buffer of the default size.


DirectByteArrayOutputStream

public DirectByteArrayOutputStream(int capacity)
Creates a new instance with a buffer of the given initial capacity.

Parameters:
capacity - Initial capacity of internal buffer.
Method Detail

getBuffer

public byte[] getBuffer()
Gets the internal byte buffer.

Returns:
Internal buffer that holds written bytes.


Copyright © 2003-2013 Virginia Tech. All Rights Reserved.