Package org.jgroups.util
Class ExposedByteArrayInputStream
java.lang.Object
java.io.InputStream
java.io.ByteArrayInputStream
org.jgroups.util.ExposedByteArrayInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Version:
- $Id: ExposedByteArrayInputStream.java,v 1.1.14.1 2008/10/28 09:39:01 belaban Exp $
- Author:
- Bela Ban
-
Field Summary
Fields inherited from class java.io.ByteArrayInputStream
buf, count, mark, pos
-
Constructor Summary
ConstructorsConstructorDescriptionExposedByteArrayInputStream
(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
Methods inherited from class java.io.ByteArrayInputStream
close, mark, markSupported, readAllBytes, readNBytes, transferTo
Methods inherited from class java.io.InputStream
nullInputStream, read, readNBytes, skipNBytes
-
Constructor Details
-
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 Details
-
setData
public void setData(byte[] buf, int offset, int length) -
read
public int read()- Overrides:
read
in classByteArrayInputStream
-
read
public int read(byte[] b, int off, int len) - Overrides:
read
in classByteArrayInputStream
-
skip
public long skip(long n) - Overrides:
skip
in classByteArrayInputStream
-
available
public int available()- Overrides:
available
in classByteArrayInputStream
-
reset
public void reset()- Overrides:
reset
in classByteArrayInputStream
-