|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.healthmarketscience.jackcess.PageChannel
public class PageChannel
Reads and writes individual pages in a database file
Constructor Summary | |
---|---|
PageChannel(java.nio.channels.FileChannel channel,
JetFormat format,
boolean autoSync)
|
Method Summary | |
---|---|
int |
allocateNewPage()
Allocates a new page in the database. |
void |
close()
|
java.nio.ByteBuffer |
createBuffer(int size)
|
java.nio.ByteBuffer |
createBuffer(int size,
java.nio.ByteOrder order)
|
java.nio.ByteBuffer |
createPageBuffer()
|
void |
deallocatePage(int pageNumber)
Deallocate a previously used page in the database. |
void |
flush()
|
JetFormat |
getFormat()
|
void |
initialize(Database database)
Does second-stage initialization, must be called after construction. |
boolean |
isOpen()
|
static java.nio.ByteBuffer |
narrowBuffer(java.nio.ByteBuffer buffer,
int position,
int limit)
|
void |
readPage(java.nio.ByteBuffer buffer,
int pageNumber)
|
int |
writeNewPage(java.nio.ByteBuffer page)
Write a page to disk as a new page, appending it to the database |
void |
writePage(java.nio.ByteBuffer page,
int pageNumber)
Write a page to disk |
void |
writePage(java.nio.ByteBuffer page,
int pageNumber,
int pageOffset)
Write a page (or part of a page) to disk |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PageChannel(java.nio.channels.FileChannel channel, JetFormat format, boolean autoSync) throws java.io.IOException
channel
- Channel containing the databaseformat
- Format of the database in the channel
java.io.IOException
Method Detail |
---|
public void initialize(Database database) throws java.io.IOException
java.io.IOException
public JetFormat getFormat()
public void readPage(java.nio.ByteBuffer buffer, int pageNumber) throws java.io.IOException
buffer
- Buffer to read the page intopageNumber
- Number of the page to read in (starting at 0)
java.io.IOException
public void writePage(java.nio.ByteBuffer page, int pageNumber) throws java.io.IOException
page
- Page to writepageNumber
- Page number to write the page to
java.io.IOException
public void writePage(java.nio.ByteBuffer page, int pageNumber, int pageOffset) throws java.io.IOException
page
- Page to writepageNumber
- Page number to write the page topageOffset
- offset within the page at which to start writing the page data
java.io.IOException
public int writeNewPage(java.nio.ByteBuffer page) throws java.io.IOException
page
- Page to write
java.io.IOException
public int allocateNewPage() throws java.io.IOException
writePage(ByteBuffer,int)
.
java.io.IOException
public void deallocatePage(int pageNumber) throws java.io.IOException
java.io.IOException
public java.nio.ByteBuffer createPageBuffer()
public java.nio.ByteBuffer createBuffer(int size)
public java.nio.ByteBuffer createBuffer(int size, java.nio.ByteOrder order)
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.nio.channels.Channel
java.io.IOException
public boolean isOpen()
isOpen
in interface java.nio.channels.Channel
public static java.nio.ByteBuffer narrowBuffer(java.nio.ByteBuffer buffer, int position, int limit)
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |