public class BundleResourceStream
extends java.io.InputStream
Modifier and Type | Field and Description |
---|---|
protected long |
contentLen |
protected java.io.InputStream |
wis |
Constructor and Description |
---|
BundleResourceStream(java.io.InputStream is,
long length)
BundleResourceStream
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Return the number of bytes available for immediate read
|
void |
close()
Close input stream
|
long |
getContentLength()
Get length of resource stream.
|
void |
mark(int readlimit)
Mark current position in input stream
|
boolean |
markSupported()
Check it mark/reset is supported.
|
int |
read()
Read a byte from the input stream.
|
int |
read(byte[] dest)
Read bytes from the input stream.
|
int |
read(byte[] dest,
int off,
int len)
Read a specified number of bytes from the input stream.
|
void |
reset()
Return to marked position.
|
long |
skip(long len)
Skip over (and discard) a specified number of bytes in this input
stream.
|
public BundleResourceStream(java.io.InputStream is, long length)
is
- Underlying input stream.public long getContentLength()
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] dest) throws java.io.IOException
read
in class java.io.InputStream
dest
- Byte array to read intojava.io.IOException
public int read(byte[] dest, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
dest
- Byte array to read intooff
- Starting offset into the byte arraylen
- Maximum number of bytes to readjava.io.IOException
public long skip(long len) throws java.io.IOException
skip
in class java.io.InputStream
len
- Number of bytes to be skippedjava.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public void mark(int readlimit)
mark
in class java.io.InputStream
readlimit
- Maximum of bytes when can save.public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
public boolean markSupported()
markSupported
in class java.io.InputStream