Package org.apache.pekko.io
Class UnsynchronizedByteArrayInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.pekko.io.UnsynchronizedByteArrayInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
@InternalApi public class UnsynchronizedByteArrayInputStream extends java.io.InputStream
Internal API: An unsynchronized byte array input stream. This class does not copy the provided byte array, and it is not thread safe.- Since:
- 2.0.0
- See Also:
ByteArrayInputStream
-
-
Constructor Summary
Constructors Constructor Description UnsynchronizedByteArrayInputStream(byte[] data)Constructs a new byte array input stream.UnsynchronizedByteArrayInputStream(byte[] data, int offset, int length)Constructs a new byte array input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidmark(int readLimit)booleanmarkSupported()intread()intread(byte[] dest)intread(byte[] dest, int off, int len)voidreset()longskip(long n)
-
-
-
Constructor Detail
-
UnsynchronizedByteArrayInputStream
public UnsynchronizedByteArrayInputStream(byte[] data)
Constructs a new byte array input stream.- Parameters:
data- the buffer
-
UnsynchronizedByteArrayInputStream
public UnsynchronizedByteArrayInputStream(byte[] data, int offset, int length)Constructs a new byte array input stream.- Parameters:
data- the bufferoffset- the offset into the bufferlength- the length of the buffer- Throws:
java.lang.IllegalArgumentException- if the offset or length less than zero
-
-
Method Detail
-
available
public int available()
- Overrides:
availablein classjava.io.InputStream
-
mark
public void mark(int readLimit)
- Overrides:
markin classjava.io.InputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
read
public int read()
- Specified by:
readin classjava.io.InputStream
-
read
public int read(byte[] dest)
- Overrides:
readin classjava.io.InputStream
-
read
public int read(byte[] dest, int off, int len)- Overrides:
readin classjava.io.InputStream
-
reset
public void reset()
- Overrides:
resetin classjava.io.InputStream
-
skip
public long skip(long n)
- Overrides:
skipin classjava.io.InputStream
-
-