@NotThreadSafe public abstract class AbstractReadOnlyFile extends Object implements ReadOnlyFile
Constructor and Description |
---|
AbstractReadOnlyFile() |
Modifier and Type | Method and Description |
---|---|
int |
read(byte[] b)
Equivalent to
read(b, 0, b.length) . |
void |
readFully(byte[] b)
Equivalent to
readFully(b, 0, b.length) . |
void |
readFully(byte[] buf,
int off,
int len)
Reads
len bytes into the given buffer at the given position. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getFilePointer, length, read, read, seek
public final int read(byte[] b) throws IOException
ReadOnlyFile
read(b, 0, b.length)
.read
in interface ReadOnlyFile
b
- The buffer to fill with data.-1
if there is
no more data because the end of the file has been reached.IOException
- On any I/O failure.public final void readFully(byte[] b) throws IOException
ReadOnlyFile
readFully(b, 0, b.length)
.readFully
in interface ReadOnlyFile
b
- the buffer to fill with data.EOFException
- If less than len
bytes are available
before the end of the file is reached.IOException
- On any I/O failure.public void readFully(byte[] buf, int off, int len) throws IOException
ReadOnlyFile
len
bytes into the given buffer at the given position.readFully
in interface ReadOnlyFile
buf
- the buffer to fill with data.off
- the start offset of the data.len
- the number of bytes to read.EOFException
- If less than len
bytes are available
before the end of the file is reached.IOException
- On any I/O failure.Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.