public class UnsafeByteArrayInputStream
extends java.io.InputStream
ByteArrayInputStream this class is not thread-safe.| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
_buf
The buffer to serve
|
protected int |
_count
The index one greater than the last byte to serve
|
protected int |
_mark
The current marked position
|
protected int |
_pos
The current position in the buffer
|
| Constructor and Description |
|---|
UnsafeByteArrayInputStream(byte[] buf)
Creates a new stream that serves the whole given array
|
UnsafeByteArrayInputStream(byte[] buf,
int off,
int len)
Creates a new stream that serves part of the given array
|
protected final byte[] _buf
protected int _pos
protected int _count
protected int _mark
public UnsafeByteArrayInputStream(byte[] buf)
buf - the array to servepublic UnsafeByteArrayInputStream(byte[] buf,
int off,
int len)
buf - the array to serveoff - the index of the first byte to servelen - the number of bytes to servepublic int read()
read in class java.io.InputStreampublic int read(byte[] b,
int off,
int len)
read in class java.io.InputStreampublic long skip(long n)
skip in class java.io.InputStreampublic int available()
available in class java.io.InputStreampublic boolean markSupported()
markSupported in class java.io.InputStreampublic void mark(int readlimit)
mark in class java.io.InputStreampublic void reset()
reset in class java.io.InputStreampublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStream