public class FreeSpaceTree
extends java.lang.Object
| Constructor and Description |
|---|
FreeSpaceTree(int firstFreeBlock,
int blockSize) |
| Modifier and Type | Method and Description |
|---|---|
long |
allocate(int length)
Allocate a number of blocks and mark them as used.
|
void |
clear()
Reset the list.
|
void |
free(long pos,
int length)
Mark the space as free.
|
void |
markUsed(long pos,
int length)
Mark the space as in use.
|
java.lang.String |
toString() |
public void clear()
public long allocate(int length)
length - the number of bytes to allocatepublic void markUsed(long pos,
int length)
pos - the position in byteslength - the number of bytespublic void free(long pos,
int length)
pos - the position in byteslength - the number of bytespublic java.lang.String toString()
toString in class java.lang.Object