org.sourceforge.jxutil.io
Class FramedByteArrayInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.ByteArrayInputStream
|
+--org.sourceforge.jxutil.io.FramedByteArrayInputStream
- public final class FramedByteArrayInputStream
- extends ByteArrayInputStream
- Version:
- $Revision: 1.2 $, $Date: 2002/03/18 19:17:38 $
- Author:
- Keve Müller
Field Summary |
private static byte[] |
EMPTY
An empty buffer. |
Method Summary |
byte[] |
getBuf()
Return the buffer. |
void |
readFrom(byte[] buf)
Replace the current buffer with given bytes. |
void |
readFrom(int len,
DataInput in)
Replace the current buffer with bytes read from the stream. |
void |
readFrom(int len,
InputStream in)
Replace the current buffer with bytes read from the stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EMPTY
private static final byte[] EMPTY
- An empty buffer.
FramedByteArrayInputStream
public FramedByteArrayInputStream()
- Construct the stream with an empty buffer.
getBuf
public byte[] getBuf()
- Return the buffer.
- Returns:
- the current buffer (live copy)
readFrom
public void readFrom(byte[] buf)
- Replace the current buffer with given bytes.
- Parameters:
buf
- the new buffer
readFrom
public void readFrom(int len,
DataInput in)
throws IOException
- Replace the current buffer with bytes read from the stream.
- Parameters:
len
- the new buffer's lengthin
- the DataInput to read from
- Throws:
IOException
- if an I/O error occurs
readFrom
public void readFrom(int len,
InputStream in)
throws IOException
- Replace the current buffer with bytes read from the stream.
- Parameters:
len
- the new buffer's lengthin
- the InputStream to read from
- Throws:
IOException
- if an I/O error occurs
Copyright © 2001,2002 Keve Müller, et al.; see LICENSE file for details.