com.healthmarketscience.jackcess
Interface CodecHandler

All Known Implementing Classes:
DefaultCodecProvider.DummyHandler, DefaultCodecProvider.UnsupportedHandler

public interface CodecHandler

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

Author:
James Ahlborn

Method Summary
 boolean canEncodePartialPage()
          Returns true if this handler can encode partial pages, false otherwise.
 void decodePage(ByteBuffer page, int pageNumber)
          Decodes the given page buffer inline.
 ByteBuffer encodePage(ByteBuffer page, int pageNumber, int pageOffset)
          Encodes the given page buffer into a new page buffer and returns it.
 

Method Detail

canEncodePartialPage

boolean canEncodePartialPage()
Returns true if this handler can encode partial pages, false otherwise. If this method returns false, the encodePage(java.nio.ByteBuffer, int, int) method will never be called with a non-zero pageOffset.


decodePage

void decodePage(ByteBuffer page,
                int pageNumber)
                throws IOException
Decodes the given page buffer inline.

Parameters:
page - the page to be decoded
pageNumber - the page number of the given page
Throws:
IOException - if an exception occurs during decoding

encodePage

ByteBuffer encodePage(ByteBuffer page,
                      int pageNumber,
                      int pageOffset)
                      throws IOException
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 - the page to be encoded, should not be modified
pageNumber - the page number of the given page
pageOffset - offset within the page at which to start writing the page data
Returns:
the properly encoded page buffer for the given page buffer
Throws:
IOException - if an exception occurs during decoding


Copyright © 2005-2013 Health Market Science. All Rights Reserved.