com.healthmarketscience.jackcess
Class DefaultCodecProvider.DummyHandler

java.lang.Object
  extended by com.healthmarketscience.jackcess.DefaultCodecProvider.DummyHandler
All Implemented Interfaces:
CodecHandler
Enclosing class:
DefaultCodecProvider

public static class DefaultCodecProvider.DummyHandler
extends Object
implements CodecHandler

CodecHandler implementation which does nothing, useful for databases with no extra encoding.


Constructor Summary
DefaultCodecProvider.DummyHandler()
           
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCodecProvider.DummyHandler

public DefaultCodecProvider.DummyHandler()
Method Detail

canEncodePartialPage

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

Specified by:
canEncodePartialPage in interface CodecHandler

decodePage

public void decodePage(ByteBuffer page,
                       int pageNumber)
                throws IOException
Description copied from interface: CodecHandler
Decodes the given page buffer inline.

Specified by:
decodePage in interface CodecHandler
Parameters:
page - the page to be decoded
pageNumber - the page number of the given page
Throws:
IOException - if an exception occurs during decoding

encodePage

public ByteBuffer encodePage(ByteBuffer page,
                             int pageNumber,
                             int pageOffset)
                      throws IOException
Description copied from interface: CodecHandler
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.

Specified by:
encodePage in interface CodecHandler
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.