Jumpi v1.2.0

org.jumpi.impl.transformer.serialization
Class FastByteArrayOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--java.io.ByteArrayOutputStream
              |
              +--org.jumpi.impl.transformer.serialization.FastByteArrayOutputStream

public class FastByteArrayOutputStream
extends java.io.ByteArrayOutputStream

An extension to the ByteArrayOutputStream to allow direct manipulation of and access to the internal byte[] for performance reasons.


Field Summary
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
FastByteArrayOutputStream(int size)
          Creates a new FastByteArrayOutputStream object.
 
Method Summary
 void clear()
          Clear the buffer's contents.
 byte[] getInternalBuffer()
          Return the internal buffer without copy.
 void setInternalBuffer(byte[] replacement)
          Set the internal 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

FastByteArrayOutputStream

public FastByteArrayOutputStream(int size)
Creates a new FastByteArrayOutputStream object.

Parameters:
size - the initial size of the internal byte[].
Method Detail

getInternalBuffer

public byte[] getInternalBuffer()
Return the internal buffer without copy.

Returns:
the internal buffer without copy.
See Also:
setInternalBuffer(byte[])

setInternalBuffer

public void setInternalBuffer(byte[] replacement)
Set the internal buffer.

Parameters:
replacement - the new internal buffer.
See Also:
getInternalBuffer()

clear

public void clear()
Clear the buffer's contents.


Jumpi v1.2.0

Copyright © 2003, Peter Jonathan Klauser.