|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deckfour.xes.nikefs2.NikeFS2Block
public class NikeFS2Block
This class implements the abstraction of a storage block for the NikeFS2 virtual file systems. Blocks have a defined size, in number of bytes, and are the basic building blocks for virtual files.
Constructor Summary | |
---|---|
NikeFS2Block(NikeFS2BlockProvider provider,
int blockNumber)
Creates a new block. |
Method Summary | |
---|---|
int |
blockNumber()
Returns the index number of this block within its block provider. |
void |
close()
Closes this block, which frees all associated resources. |
int |
read(int blockOffset)
Read a single byte from this block. |
int |
read(int blockOffset,
byte[] buffer)
Read a number of bytes from this block. |
int |
read(int blockOffset,
byte[] buffer,
int offset,
int length)
Read a number of bytes from this block. |
int |
size()
Returns the size of this block in bytes. |
void |
write(int blockOffset,
byte[] buffer)
Writes a number of bytes to this block. |
void |
write(int blockOffset,
byte[] buffer,
int offset,
int length)
Writes a number of bytes to this block. |
void |
write(int blockOffset,
int value)
Writes a single byte to this block. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NikeFS2Block(NikeFS2BlockProvider provider, int blockNumber)
provider
- The provider of this block.blockNumber
- The block number.Method Detail |
---|
public int size()
public int blockNumber()
public void close()
public int read(int blockOffset, byte[] buffer, int offset, int length) throws IOException
blockOffset
- Offset, in bytes, within this block.buffer
- Buffer to store read data in.offset
- Offset within the buffer to write to.length
- Number of bytes to be read.
IOException
public int read(int blockOffset, byte[] buffer) throws IOException
blockOffset
- Offset, in bytes, within this block.buffer
- Buffer to store read data in.
IOException
public int read(int blockOffset) throws IOException
blockOffset
- Offset, in bytes, within this block.
IOException
public void write(int blockOffset, byte[] buffer, int offset, int length) throws IOException
blockOffset
- Offset within the block to commence writing at.buffer
- Buffer storing the data to be written.offset
- Offset within the buffer from where to read.length
- Number of bytes to be written.
IOException
public void write(int blockOffset, byte[] buffer) throws IOException
blockOffset
- Offset within the block to commence writing at.buffer
- Buffer storing the data to be written.
IOException
public void write(int blockOffset, int value) throws IOException
blockOffset
- Offset within the block to commence writing at.value
- The byte to be written.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |