de.undercouch.bson4jackson.io
Class UnsafeByteArrayInputStream
java.lang.Object
java.io.InputStream
de.undercouch.bson4jackson.io.UnsafeByteArrayInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class UnsafeByteArrayInputStream
- extends java.io.InputStream
An input stream that serves the content of an array. Compared to
ByteArrayInputStream this class is not thread-safe.
| Methods inherited from class java.io.InputStream |
read |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnsafeByteArrayInputStream
public UnsafeByteArrayInputStream(byte[] buf)
- Creates a new stream that serves the whole given array
- Parameters:
buf - the array to serve
UnsafeByteArrayInputStream
public UnsafeByteArrayInputStream(byte[] buf,
int off,
int len)
- Creates a new stream that serves part of the given array
- Parameters:
buf - the array to serveoff - the index of the first byte to servelen - the number of bytes to serve
read
public int read()
- Specified by:
read in class java.io.InputStream
read
public int read(byte[] b,
int off,
int len)
- Overrides:
read in class java.io.InputStream
skip
public long skip(long n)
- Overrides:
skip in class java.io.InputStream
available
public int available()
- Overrides:
available in class java.io.InputStream
markSupported
public boolean markSupported()
- Overrides:
markSupported in class java.io.InputStream
mark
public void mark(int readlimit)
- Overrides:
mark in class java.io.InputStream
reset
public void reset()
- Overrides:
reset in class java.io.InputStream
close
public void close()
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class java.io.InputStream