|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Block oriented I/O operations.
| Method Summary | |
void |
addStructuredFileListener(StructuredFileListener listener)
Adds a to the listener list. |
void |
deleteBlocks(long index,
long count)
Removes blocks. |
long |
getBlockCount()
Reads the total amount of existing blocks. |
int |
getBlockSize()
Reads the length of one block in byte. |
StructuredFileListener[] |
getStructuredFileListeners()
Accessor to all currently registered s. |
void |
insertBlocks(long index,
long count)
Inserts new blocks. |
void |
readBlock(long block,
int off,
byte[] buf)
Reads byte starting at position in . |
void |
readBlock(long block,
int off,
byte[] buf,
int index,
int length)
Reads byte starting at position in into starting at inclusive. |
void |
removeStructuredFileListener(StructuredFileListener listener)
Removes a from the listener list. |
void |
writeBlock(long block,
int off,
byte[] buf)
Writes byte from into starting at inclusive. |
void |
writeBlock(long block,
int off,
byte[] buf,
int index,
int length)
Writes byte from starting at inclusive into starting at inclusive. |
| Method Detail |
public void addStructuredFileListener(StructuredFileListener listener)
listener - The listener to be added to the listener list.
NullPointerException - if is .
public void deleteBlocks(long index,
long count)
throws IOException
index - index of the first block to start removing
blocks.count - number of blocks to remove.
IndexOutOfBoundsException - if is negative or
is negative or zero or is greater than
.
IOException - if deleting blocks fails.
public long getBlockCount()
throws IOException
IOException - if getting the block count fails.
public int getBlockSize()
throws IOException
IOException - if getting the block size fails.public StructuredFileListener[] getStructuredFileListeners()
public void insertBlocks(long index,
long count)
throws IOException
index - index of the first new block.count - number of blocks to insert starting at .
IndexOutOfBoundsException - if or is
negativ or is greater than or
is zero or greater than
.
IOException - if inserting blocks fails.
public void readBlock(long block,
int off,
byte[] buf)
throws IOException
block - index of the block to read data from.off - starting offset to the data to read from .buf - array to store the data in.
NullPointerException - if is .
IndexOutOfBoundsException - if is negative,
greater than or equal to , or is
negative, greater than or equal to , or the length
of is greater than .
IOException - if reading fails.
public void readBlock(long block,
int off,
byte[] buf,
int index,
int length)
throws IOException
block - index of the block to read data from.off - starting offset of the data to read from .buf - array to store the data in.index - offset to start writing data into .length - number of byte to read.
NullPointerException - if is .
IndexOutOfBoundsException - if is negative,
greater than or equal to , or is
negative, greater than or equal to , or
is negative, greater than or equal to the length of
, or is negative or greater than the
length of minus or greater than
.
IOException - if reading fails.public void removeStructuredFileListener(StructuredFileListener listener)
listener - The listener to be removed from the listener list.
NullPointerException - if is .
public void writeBlock(long block,
int off,
byte[] buf)
throws IOException
block - index of the block to write into.off - inclusive offset to start writing into .buf - data to write into beginning at .
NullPointerException - if is .
IndexOutOfBoundsException - if is negative,
greater than or equal to , or is
greater than or equal to , or the length of
is greater than .
IOException - if writing fails.
public void writeBlock(long block,
int off,
byte[] buf,
int index,
int length)
throws IOException
block - index of the block to write into.off - inclusive offset to start writing into .buf - data to write into beginning at .index - inclusive offset to start reading data from .length - number of byte to read from starting at
.
NullPointerException - if is .
IndexOutOfBoundsException - if is negative,
greater than or equal to , or is
negative, greater than or equal to , or
is negative, greater than or equal to the length of
, or is negative or greater than the
length of minus or greater than
.
IOException - if writing fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||