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 aByteArrayInputStreamso that it usesbufas its buffer array.ExposedByteArrayInputStream(byte[] buf, int offset, int length) CreatesByteArrayInputStreamthat usesbufas its buffer array. -
Method Summary
Methods inherited from class java.io.ByteArrayInputStream
close, mark, markSupported, readAllBytes, readNBytes, transferToMethods inherited from class java.io.InputStream
nullInputStream, read, readNBytes, skipNBytes
-
Constructor Details
-
ExposedByteArrayInputStream
public ExposedByteArrayInputStream(byte[] buf) Creates aByteArrayInputStreamso that it usesbufas its buffer array. The buffer array is not copied. The initial value ofposis0and the initial value ofcountis the length ofbuf.- Parameters:
buf- the input buffer.
-
ExposedByteArrayInputStream
public ExposedByteArrayInputStream(byte[] buf, int offset, int length) CreatesByteArrayInputStreamthat usesbufas its buffer array. The initial value ofposisoffsetand the initial value ofcountis the minimum ofoffset+lengthandbuf.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:
readin classByteArrayInputStream
-
read
public int read(byte[] b, int off, int len) - Overrides:
readin classByteArrayInputStream
-
skip
public long skip(long n) - Overrides:
skipin classByteArrayInputStream
-
available
public int available()- Overrides:
availablein classByteArrayInputStream
-
reset
public void reset()- Overrides:
resetin classByteArrayInputStream
-