Jumpi v1.2.0

org.jumpi.impl.transformer.serialization
Class FastByteArrayInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--java.io.ByteArrayInputStream
              |
              +--org.jumpi.impl.transformer.serialization.FastByteArrayInputStream

public class FastByteArrayInputStream
extends java.io.ByteArrayInputStream

An extension of ByteArrayInputStream to allow direct manipulation of and access to the internal buffer for performance reasons.


Field Summary
 
Fields inherited from class java.io.ByteArrayInputStream
buf, count, mark, pos
 
Constructor Summary
FastByteArrayInputStream(byte[] buf)
          Creates a new FastByteArrayInputStream object.
FastByteArrayInputStream(int size)
          Creates a new FastByteArrayInputStream object.
 
Method Summary
 void clear()
          Clear the internal buffer.
 byte[] getInternalBuffer()
          Return the internal buffer without copy.
 void setInternalBuffer(byte[] replacement)
          Set the internal buffer.
 
Methods inherited from class java.io.ByteArrayInputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.io.InputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastByteArrayInputStream

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

Parameters:
size - the initial size of the internal buffer.

FastByteArrayInputStream

public FastByteArrayInputStream(byte[] buf)
Creates a new FastByteArrayInputStream object.

Parameters:
buf - the buffer to use as the internal buffer.
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 internal buffer.


Jumpi v1.2.0

Copyright © 2003, Peter Jonathan Klauser.