public class RandomAccessFileInputStream extends InputStream
RandomAccessFile
starting at its current position.Constructor and Description |
---|
RandomAccessFileInputStream(RandomAccessFile file)
Constructs a new instance configured to leave the underlying file open when this stream is closed.
|
RandomAccessFileInputStream(RandomAccessFile file,
boolean closeOnClose)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream.
|
long |
availableLong()
Returns the number of bytes that can be read (or skipped over) from this input stream.
|
void |
close() |
RandomAccessFile |
getRandomAccessFile()
Gets the underlying file.
|
boolean |
isCloseOnClose()
Returns whether to close the underlying file when this stream is closed.
|
int |
read() |
int |
read(byte[] bytes) |
int |
read(byte[] bytes,
int offset,
int length) |
long |
skip(long skipCount) |
mark, markSupported, reset
public RandomAccessFileInputStream(RandomAccessFile file)
file
- The file to stream.public RandomAccessFileInputStream(RandomAccessFile file, boolean closeOnClose)
file
- The file to stream.closeOnClose
- Whether to close the underlying file when this stream is closed.public int available() throws IOException
Integer.MAX_VALUE
bytes available, return Integer.MAX_VALUE
.available
in class InputStream
IOException
- If an I/O error occurs.public long availableLong() throws IOException
IOException
- If an I/O error occurs.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public RandomAccessFile getRandomAccessFile()
public boolean isCloseOnClose()
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] bytes) throws IOException
read
in class InputStream
IOException
public int read(byte[] bytes, int offset, int length) throws IOException
read
in class InputStream
IOException
public long skip(long skipCount) throws IOException
skip
in class InputStream
IOException
Jas4pp 1.5 © Java Analysis Studio for Particle Physics