public class FileCacheRandomAccessInputStream extends RandomAccessInputStream
Based on com.sun.media.jai.codec.FileCacheSeekableStream.
closed, src| Constructor and Description |
|---|
FileCacheRandomAccessInputStream(java.io.InputStream stream)
Constructs a
MemoryCacheRandomAccessInputStream
that takes its source data from a regular InputStream. |
FileCacheRandomAccessInputStream(java.io.InputStream src,
int bufLen) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this stream and releases any system resources
associated with the stream.
|
long |
getStreamPointer()
Returns the current offset in this stream.
|
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
seek(long pos)
Sets the stream-pointer offset, measured from the beginning of this
file, at which the next read occurs.
|
void |
shallowClose()
Closes the RandomAccessInputStream and but keeps it's underlying stream open
|
ensureOpen, finalize, getEndian, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readS15Fixed16Number, readShort, readU16Fixed16Number, readU8Fixed8Number, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, setReadStrategy, skipBytespublic FileCacheRandomAccessInputStream(java.io.InputStream stream)
throws java.io.IOException
MemoryCacheRandomAccessInputStream
that takes its source data from a regular InputStream.
Seeking backwards is supported by means of an file cache.
An IOException will be thrown if the
attempt to create the cache file fails for any reason.
java.io.IOExceptionpublic FileCacheRandomAccessInputStream(java.io.InputStream src,
int bufLen)
throws java.io.IOException
java.io.IOExceptionpublic long getStreamPointer()
getStreamPointer in class RandomAccessInputStreampublic void seek(long pos)
throws java.io.IOException
seek in class RandomAccessInputStreampos - the offset position, measured in bytes from the
beginning of the stream, at which to set the stream
pointer.java.io.IOException - if pos is less than
0 or if an I/O error occurs.public int read()
throws java.io.IOException
read in class RandomAccessInputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class RandomAccessInputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOException - if an I/O error occurs.public void shallowClose()
throws java.io.IOException
RandomAccessInputStreamshallowClose in class RandomAccessInputStreamjava.io.IOException