Package net.metanotion.io.block
Class FreeListBlock
java.lang.Object
net.metanotion.io.block.FreeListBlock
On-disk format:
Magic number (long) next freelist block page (unsigned int) size (unsigned int) that many free pages (unsigned ints)Always fits on one page. Free page format:
Magic number (long)
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPage
(int freePage) Adds free page and writes new len to diskboolean
flbck
(boolean fix) Recursive.int
static void
initPage
(RandomAccessInterface file, int page) boolean
isEmpty()
boolean
isFull()
void
setNextPage
(int nxt) Set and write the next page onlyint
takePage()
Takes next page and writes new len to disktoString()
void
-
Field Details
-
page
public final int page
-
-
Constructor Details
-
FreeListBlock
- Throws:
IOException
-
-
Method Details
-
writeBlock
- Throws:
IOException
-
getNextPage
public int getNextPage() -
setNextPage
Set and write the next page only- Throws:
IOException
-
isEmpty
public boolean isEmpty() -
isFull
public boolean isFull() -
addPage
Adds free page and writes new len to disk- Throws:
IllegalStateException
- if fullIOException
-
takePage
Takes next page and writes new len to disk- Throws:
IllegalStateException
- if emptyIOException
-
initPage
- Throws:
IOException
-
flbck
Recursive.- Throws:
IOException
- Since:
- 0.9.7
-
toString
-