|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Disk FastDisk
A new and improved Disk. You may not change this class.
This disk is so much faster than the previous model that read and write operations appear to finish in no time. Because disk is so fast, beginRead and beginWrite wait for the operation to finish rather than causing a CPU interrupt when they complete.
Disk
,
Kernel
Nested Class Summary |
Nested classes inherited from class Disk |
Disk.DiskException |
Field Summary |
Fields inherited from class Disk |
BLOCK_SIZE, busy, currentBlock, data, DISK_SIZE, readCount, targetBlock, writeCount |
Constructor Summary | |
FastDisk(int size)
Creates a new FastDisk. |
Method Summary | |
void |
beginRead(int blockNumber,
byte[] buffer)
Deprecated. Do not use this method. Use read instead. |
void |
beginWrite(int blockNumber,
byte[] buffer)
Deprecated. Do not use this method. Use read instead. |
void |
read(int blockNumber,
byte[] buffer)
Performs a read operation. |
void |
write(int blockNumber,
byte[] buffer)
Performs a write operation. |
Methods inherited from class Disk |
delay, finishOperation, flush, run, waitForRequest |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FastDisk(int size)
size
- the total size of this disk, in blocks.Method Detail |
public void read(int blockNumber, byte[] buffer)
blockNumber
- The block number to read from.buffer
- a data area to hold the data read.Disk.beginRead(int, byte[])
public void write(int blockNumber, byte[] buffer)
blockNumber
- The block number to write to.buffer
- a data area to hold the data to be written.Disk.beginWrite(int, byte[])
public void beginRead(int blockNumber, byte[] buffer)
beginRead
in class Disk
blockNumber
- The block number to read from.buffer
- A data area to hold the data read. This array must be
allocated by the caller and have length of at least
BLOCK_SIZE. If it is larger, only the first BLOCK_SIZE
bytes of the array will be modified.public void beginWrite(int blockNumber, byte[] buffer)
beginWrite
in class Disk
blockNumber
- The block number to write to.buffer
- A data area containing the data to be written. This array
must be allocated by the caller and have length of at least
BLOCK_SIZE. If it is larger, only the first BLOCK_SIZE
bytes of the array will be sent to the disk.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |