|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BlockDevice
This is the abstraction used for a device that can hold a FileSystem
.
Method Summary | |
---|---|
void |
close()
Closes this BlockDevice . |
void |
flush()
Flushes data in caches to the actual storage. |
int |
getSectorSize()
Returns the size of a sector on this device. |
long |
getSize()
Gets the total length of this device in bytes. |
boolean |
isClosed()
Checks if this device was already closed. |
boolean |
isReadOnly()
Checks if this BlockDevice is read-only. |
void |
read(long devOffset,
ByteBuffer dest)
Read a block of data from this device. |
void |
write(long devOffset,
ByteBuffer src)
Writes a block of data to this device. |
Method Detail |
---|
long getSize() throws IOException
IOException
- on error getting the size of this devicevoid read(long devOffset, ByteBuffer dest) throws IOException
devOffset
- the byte offset where to read the data fromdest
- the destination buffer where to store the data read
IOException
- on read errorvoid write(long devOffset, ByteBuffer src) throws ReadOnlyException, IOException, IllegalArgumentException
devOffset
- the byte offset where to store the datasrc
- the source ByteBuffer
to write to the device
ReadOnlyException
- if this BlockDevice
is read-only
IOException
- on write error
IllegalArgumentException
- if the devOffset
is negative
or the write would go beyond the end of the deviceisReadOnly()
void flush() throws IOException
IOException
- on write errorint getSectorSize() throws IOException
IOException
- on error determining the sector sizevoid close() throws IOException
BlockDevice
. No methods of this device may be
accesses after this method was called.
IOException
- on error closing this deviceisClosed()
boolean isClosed()
boolean isReadOnly()
BlockDevice
is read-only.
BlockDevice
is read-only
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |