FreeSpaceTree

A list that maintains ranges of free space (in blocks) in a file.

Methods
long allocate(int length)
Allocate a number of blocks and mark them as used.
long allocate(int length)
Allocate a number of blocks and mark them as used.
Parameters:
length - the number of bytes to allocate
Returns:
the start position in bytes
void clear()
Reset the list.
void clear()
Reset the list.
void free(long pos, int length)
Mark the space as free.
void free(long pos, int length)
Mark the space as free.
Parameters:
pos - the position in bytes
length - the number of bytes
void markUsed(long pos, int length)
Mark the space as in use.
void markUsed(long pos, int length)
Mark the space as in use.
Parameters:
pos - the position in bytes
length - the number of bytes
String toString()
String toString()