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, skipBytes
public 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.IOException
public FileCacheRandomAccessInputStream(java.io.InputStream src, int bufLen) throws java.io.IOException
java.io.IOException
public long getStreamPointer()
getStreamPointer
in class RandomAccessInputStream
public void seek(long pos) throws java.io.IOException
seek
in class RandomAccessInputStream
pos
- 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 RandomAccessInputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class RandomAccessInputStream
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
- if an I/O error occurs.public void shallowClose() throws java.io.IOException
RandomAccessInputStream
shallowClose
in class RandomAccessInputStream
java.io.IOException