public interface DataAccessor
Modifier and Type | Method and Description |
---|---|
void |
append(byte[] buffer,
int off,
int len)
Appends exactly
len bytes, starting at off of the buffer pointer
to the end of file resource. |
void |
close()
Closes DataAccessor file resource
|
int |
getFileLength() |
long |
getFilePointer()
Returns the current offset in this file.
|
void |
open(boolean requestWrite)
Opens DataAccessor file resource
|
void |
read(byte[] buffer,
int off,
int len)
Reads up to len bytes of data from this file resource into an array of bytes.
|
void |
resetFile()
Clears the file and sets the offset to 0
|
void |
seek(long pos)
Sets the file-pointer offset, measured from the beginning of this
file, at which the next read or write occurs.
|
void open(boolean requestWrite) throws IOException
requestWrite
- if true, file is opened for read/write operation.IOException
void close() throws IOException
IOException
void read(byte[] buffer, int off, int len) throws IOException
buffer
- the buffer into which the data is read.off
- the start offset of the data.len
- the maximum number of bytes read.IOException
void append(byte[] buffer, int off, int len) throws IOException
len
bytes, starting at off
of the buffer pointer
to the end of file resource.buffer
- the buffer from which the data is appended.off
- the start offset of the data in the buffer.len
- the number of bytes to append.IOException
long getFilePointer() throws IOException
IOException
void resetFile() throws IOException
IOException
void seek(long pos) throws IOException
IOException
int getFileLength()