|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IOAdapter
Interface to handle IO operations with file.
ByteBuffer| Method Summary | |
|---|---|
void |
close()
Closes the IO Adapter |
long |
getFileLength()
Returns the length of the file |
byte[] |
read(long location,
int length)
Reads the contents and return it as byte array. |
java.nio.ByteBuffer[] |
readFileAsBlocks()
Reads the entire contents of the file as ByteBuffer array. The contents as divided as block based on the block size value |
java.nio.ByteBuffer |
readIntoBuffer(long location)
Reads the contents into the temporary buffer and returns it as ByteBuffer |
void |
write(byte[] block,
long location)
Writes the contents to the specified location. |
void |
write(java.nio.ByteBuffer[] blocks,
long location)
Writes the contents provided as array to the specified location. |
void |
write(java.nio.ByteBuffer block,
long location)
Writes the contents to the specified location. |
| Method Detail |
|---|
void close()
throws java.io.IOException
java.io.IOException - if file operation failslong getFileLength()
byte[] read(long location,
int length)
throws java.io.IOException
location - location of the content in filelength - length of the content to read from the specified location
java.io.IOException
java.nio.ByteBuffer[] readFileAsBlocks()
throws java.io.IOException
java.io.IOException - if file operation fails
java.nio.ByteBuffer readIntoBuffer(long location)
throws java.io.IOException
location - location to be read
java.io.IOException - if file operation fails
void write(byte[] block,
long location)
throws java.io.IOException
block - the content block as byteslocation - location to be written
java.io.IOException - if file operation fails
void write(java.nio.ByteBuffer[] blocks,
long location)
throws java.io.IOException
blocks - contents as array of blockslocation - location to be written
java.io.IOException - if file operation fails
void write(java.nio.ByteBuffer block,
long location)
throws java.io.IOException
block - the content blocklocation - location to be written
java.io.IOException - if file operation fails
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||