APIdia Launch Partner
Top Description Methods
io.github.spannm.jackcess.impl

public Interface CodecHandler

Known Direct Implementers
io.github.spannm.jackcess.impl.DefaultCodecProvider.DummyHandler, io.github.spannm.jackcess.impl.DefaultCodecProvider.UnsupportedHandler
Imports
java.nio.ByteBuffer

Interface for a handler which can encode/decode a specific access page encoding.

Method Summary

Modifier and TypeMethod and Description
public boolean
canDecodeInline()

Returns true if this handler can decode a page inline, false otherwise.

public boolean
canEncodePartialPage()

Returns true if this handler can encode partial pages, false otherwise.

public void
decodePage(ByteBuffer
the page to be decoded
inPage
,
ByteBuffer
the decoded page. if canDecodeInline is true, this will be the same buffer as inPage.
outPage
,
int
the page number of the given page
pageNumber
)

Decodes the given page buffer.

public ByteBuffer

Returns:

the properly encoded page buffer for the given page buffer
encodePage
(ByteBuffer
the page to be encoded, should not be modified
page
,
int
the page number of the given page
pageNumber
,
int
offset within the page at which to start writing the page data
pageOffset
)

Encodes the given page buffer into a new page buffer and returns it.

Method Detail

canDecodeInlineback to summary
public boolean canDecodeInline()

Returns true if this handler can decode a page inline, false otherwise. If this method returns false, the decodePage method will always be called with separate buffers.

canEncodePartialPageback to summary
public boolean canEncodePartialPage()

Returns true if this handler can encode partial pages, false otherwise. If this method returns false, the encodePage method will never be called with a non-zero pageOffset.

decodePageback to summary
public void decodePage(ByteBuffer inPage, ByteBuffer outPage, int pageNumber)

Decodes the given page buffer.

Parameters
inPage:ByteBuffer

the page to be decoded

outPage:ByteBuffer

the decoded page. if canDecodeInline is true, this will be the same buffer as inPage.

pageNumber:int

the page number of the given page

encodePageback to summary
public ByteBuffer encodePage(ByteBuffer page, int pageNumber, int pageOffset)

Encodes the given page buffer into a new page buffer and returns it. The returned page buffer will be used immediately and discarded so that it may be re-used for subsequent page encodings.

Parameters
page:ByteBuffer

the page to be encoded, should not be modified

pageNumber:int

the page number of the given page

pageOffset:int

offset within the page at which to start writing the page data

Returns:ByteBuffer

the properly encoded page buffer for the given page buffer