Package org.jgroups.util
Class ExposedByteArrayInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.ByteArrayInputStream
-
- org.jgroups.util.ExposedByteArrayInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ExposedByteArrayInputStream extends java.io.ByteArrayInputStream
- Version:
- $Id: ExposedByteArrayInputStream.java,v 1.1.14.1 2008/10/28 09:39:01 belaban Exp $
- Author:
- Bela Ban
-
-
Constructor Summary
Constructors Constructor Description ExposedByteArrayInputStream(byte[] buf)
Creates aByteArrayInputStream
so that it usesbuf
as its buffer array.ExposedByteArrayInputStream(byte[] buf, int offset, int length)
CreatesByteArrayInputStream
that usesbuf
as its buffer array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
int
read()
int
read(byte[] b, int off, int len)
void
reset()
void
setData(byte[] buf, int offset, int length)
long
skip(long n)
-
-
-
Constructor Detail
-
ExposedByteArrayInputStream
public ExposedByteArrayInputStream(byte[] buf)
Creates aByteArrayInputStream
so that it usesbuf
as its buffer array. The buffer array is not copied. The initial value ofpos
is0
and the initial value ofcount
is the length ofbuf
.- Parameters:
buf
- the input buffer.
-
ExposedByteArrayInputStream
public ExposedByteArrayInputStream(byte[] buf, int offset, int length)
CreatesByteArrayInputStream
that usesbuf
as its buffer array. The initial value ofpos
isoffset
and the initial value ofcount
is the minimum ofoffset+length
andbuf.length
. The buffer array is not copied. The buffer's mark is set to the specified offset.- Parameters:
buf
- the input buffer.offset
- the offset in the buffer of the first byte to read.length
- the maximum number of bytes to read from the buffer.
-
-
Method Detail
-
setData
public void setData(byte[] buf, int offset, int length)
-
read
public int read()
- Overrides:
read
in classjava.io.ByteArrayInputStream
-
read
public int read(byte[] b, int off, int len)
- Overrides:
read
in classjava.io.ByteArrayInputStream
-
skip
public long skip(long n)
- Overrides:
skip
in classjava.io.ByteArrayInputStream
-
available
public int available()
- Overrides:
available
in classjava.io.ByteArrayInputStream
-
reset
public void reset()
- Overrides:
reset
in classjava.io.ByteArrayInputStream
-
-