RandomAccessFileInputstreampublic final class RandomAccessFileInputstream extends InputStream Wraps a {@link RandomAccessFile} into an {@link InputStream}.
|
Fields Summary |
---|
private final RandomAccessFile | sourceThe file access to read from.
|
Constructors Summary |
---|
public RandomAccessFileInputstream(RandomAccessFile file)Creates an instance that will provide {@link InputStream} functionality
on the given {@link RandomAccessFile} by delegating calls.
super();
if (file == null) {
throw new IllegalArgumentException("null");
}
this.source = file;
|
Methods Summary |
---|
public int | read(){@inheritDoc}
return this.source.read();
| public int | read(byte[] buffer, int off, int len){@inheritDoc}
return this.source.read(buffer, off, len);
| public long | skip(long amount){@inheritDoc}
if (amount < 0) {
throw new IllegalArgumentException("invalid negative value");
}
long left = amount;
while (left > Integer.MAX_VALUE) {
this.source.skipBytes(Integer.MAX_VALUE);
left -= Integer.MAX_VALUE;
}
return this.source.skipBytes((int) left);
|
|