public class RandomAccessFileInputStream
extends java.io.InputStream
RandomAccessFile
starting at its current position.
To build an instance, see RandomAccessFileInputStream.Builder
.
Modifier and Type | Class and Description |
---|---|
static class |
RandomAccessFileInputStream.Builder
Builds a new
RandomAccessFileInputStream instance. |
Constructor and Description |
---|
RandomAccessFileInputStream(java.io.RandomAccessFile file)
Deprecated.
|
RandomAccessFileInputStream(java.io.RandomAccessFile file,
boolean closeOnClose)
Deprecated.
|
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.
|
static RandomAccessFileInputStream.Builder |
builder()
Constructs a new
RandomAccessFileInputStream.Builder . |
void |
close() |
java.io.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) |
@Deprecated public RandomAccessFileInputStream(java.io.RandomAccessFile file)
builder()
, RandomAccessFileInputStream.Builder
, and RandomAccessFileInputStream.Builder.get()
file
- The file to stream.@Deprecated public RandomAccessFileInputStream(java.io.RandomAccessFile file, boolean closeOnClose)
builder()
, RandomAccessFileInputStream.Builder
, and RandomAccessFileInputStream.Builder.get()
file
- The file to stream.closeOnClose
- Whether to close the underlying file when this stream is closed.public static RandomAccessFileInputStream.Builder builder()
RandomAccessFileInputStream.Builder
.RandomAccessFileInputStream.Builder
.public int available() throws java.io.IOException
Integer.MAX_VALUE
bytes available, return Integer.MAX_VALUE
.available
in class java.io.InputStream
java.io.IOException
- If an I/O error occurs.public long availableLong() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.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 java.io.RandomAccessFile getRandomAccessFile()
public boolean isCloseOnClose()
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] bytes) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] bytes, int offset, int length) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public long skip(long skipCount) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
Copyright © 2010 - 2023 Adobe. All Rights Reserved