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 aByteArrayInputStreamso that it usesbufas its buffer array.ExposedByteArrayInputStream(byte[] buf, int offset, int length)CreatesByteArrayInputStreamthat usesbufas its buffer array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()intread()intread(byte[] b, int off, int len)voidreset()voidsetData(byte[] buf, int offset, int length)longskip(long n)
-
-
-
Constructor Detail
-
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 Detail
-
setData
public void setData(byte[] buf, int offset, int length)
-
read
public int read()
- Overrides:
readin classjava.io.ByteArrayInputStream
-
read
public int read(byte[] b, int off, int len)- Overrides:
readin classjava.io.ByteArrayInputStream
-
skip
public long skip(long n)
- Overrides:
skipin classjava.io.ByteArrayInputStream
-
available
public int available()
- Overrides:
availablein classjava.io.ByteArrayInputStream
-
reset
public void reset()
- Overrides:
resetin classjava.io.ByteArrayInputStream
-
-