|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.healthmarketscience.jackcess.PageChannel
public class PageChannel
Reads and writes individual pages in a database file
Constructor Summary | |
---|---|
PageChannel(FileChannel channel,
boolean closeChannel,
JetFormat format,
boolean autoSync)
|
Method Summary | |
---|---|
int |
allocateNewPage()
Allocates a new page in the database. |
void |
close()
|
ByteBuffer |
createBuffer(int size)
|
ByteBuffer |
createBuffer(int size,
ByteOrder order)
|
ByteBuffer |
createPageBuffer()
|
void |
deallocatePage(int pageNumber)
Deallocate a previously used page in the database. |
void |
flush()
|
JetFormat |
getFormat()
|
void |
initialize(Database database,
CodecProvider codecProvider)
Does second-stage initialization, must be called after construction. |
boolean |
isAutoSync()
|
boolean |
isOpen()
|
static ByteBuffer |
narrowBuffer(ByteBuffer buffer,
int position,
int limit)
|
void |
readPage(ByteBuffer buffer,
int pageNumber)
|
static ByteBuffer |
wrap(byte[] bytes)
Returns a ByteBuffer wrapping the given bytes and configured with the default byte order. |
void |
writePage(ByteBuffer page,
int pageNumber)
Write a page to disk |
void |
writePage(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(FileChannel channel, boolean closeChannel, JetFormat format, boolean autoSync) throws IOException
channel
- Channel containing the databaseformat
- Format of the database in the channel
IOException
Method Detail |
---|
public void initialize(Database database, CodecProvider codecProvider) throws IOException
IOException
public JetFormat getFormat()
public boolean isAutoSync()
public void readPage(ByteBuffer buffer, int pageNumber) throws IOException
buffer
- Buffer to read the page intopageNumber
- Number of the page to read in (starting at 0)
IOException
public void writePage(ByteBuffer page, int pageNumber) throws IOException
page
- Page to writepageNumber
- Page number to write the page to
IOException
public void writePage(ByteBuffer page, int pageNumber, int pageOffset) throws IOException
page
- Page to writepageNumber
- Page number to write the page topageOffset
- offset within the page at which to start writing the
page data
IOException
public int allocateNewPage() throws IOException
writePage(ByteBuffer,int)
.
IOException
public void deallocatePage(int pageNumber) throws IOException
IOException
public ByteBuffer createPageBuffer()
public ByteBuffer createBuffer(int size)
public ByteBuffer createBuffer(int size, ByteOrder order)
public void flush() throws IOException
flush
in interface Flushable
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface Channel
IOException
public boolean isOpen()
isOpen
in interface Channel
public static ByteBuffer narrowBuffer(ByteBuffer buffer, int position, int limit)
public static ByteBuffer wrap(byte[] bytes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |