|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FsFile
A FsFile is a representation of a single block of bytes on a filesystem. It is comparable to an inode in Unix. An FsFile does not have any knowledge of who is using this file. It is also possible that the system uses a single FsFile instance to create two inputstream's for two different principals.
| Method Summary | |
|---|---|
void |
flush()
Flush any possibly cached data to the disk. |
long |
getLength()
Gets the length (in bytes) of this file. |
void |
read(long offset,
ByteBuffer dest)
Reads from this file into the specified ByteBuffer. |
void |
setLength(long length)
Sets the length of this file. |
void |
write(long offset,
ByteBuffer src)
Writes to this file taking the data to write from the specified ByteBuffer. |
| Methods inherited from interface de.waldheinz.fs.FsObject |
|---|
isReadOnly, isValid |
| Method Detail |
|---|
long getLength()
void setLength(long length)
throws IOException
length - the new length of this file
IOException - on error updating the file size
void read(long offset,
ByteBuffer dest)
throws IOException
ByteBuffer. The
first byte read will be put into the buffer at it's
position, and the number of bytes read
will equal the buffer's remaining bytes.
offset - the offset into the file where to start readingdest - the destination buffer where to put the bytes that were read
IOException - on read error
void write(long offset,
ByteBuffer src)
throws ReadOnlyException,
IOException
ByteBuffer. This method will read the buffer's
remaining bytes starting at it's
position.
offset - the offset into the file where the first byte will be
writtensrc - the source buffer to read the data from
ReadOnlyException - if the file is read-only
IOException - on write error
void flush()
throws IOException
IOException - on error flushing
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||