Class DefaultCodecProvider.UnsupportedHandler
- java.lang.Object
-
- com.healthmarketscience.jackcess.impl.DefaultCodecProvider.UnsupportedHandler
-
- All Implemented Interfaces:
CodecHandler
- Enclosing class:
- DefaultCodecProvider
public static class DefaultCodecProvider.UnsupportedHandler extends Object implements CodecHandler
CodecHandler implementation which always throws UnsupportedCodecException, useful for databases with unsupported encodings.
-
-
Constructor Summary
Constructors Constructor Description UnsupportedHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDecodeInline()Returnstrueif this handler can decode a page inline,falseotherwise.booleancanEncodePartialPage()Returnstrueif this handler can encode partial pages,falseotherwise.voiddecodePage(ByteBuffer inPage, ByteBuffer outPage, int pageNumber)Decodes the given page buffer.ByteBufferencodePage(ByteBuffer page, int pageNumber, int pageOffset)Encodes the given page buffer into a new page buffer and returns it.
-
-
-
Method Detail
-
canEncodePartialPage
public boolean canEncodePartialPage()
Description copied from interface:CodecHandlerReturnstrueif this handler can encode partial pages,falseotherwise. If this method returnsfalse, theCodecHandler.encodePage(java.nio.ByteBuffer, int, int)method will never be called with a non-zero pageOffset.- Specified by:
canEncodePartialPagein interfaceCodecHandler
-
canDecodeInline
public boolean canDecodeInline()
Description copied from interface:CodecHandlerReturnstrueif this handler can decode a page inline,falseotherwise. If this method returnsfalse, theCodecHandler.decodePage(java.nio.ByteBuffer, java.nio.ByteBuffer, int)method will always be called with separate buffers.- Specified by:
canDecodeInlinein interfaceCodecHandler
-
decodePage
public void decodePage(ByteBuffer inPage, ByteBuffer outPage, int pageNumber) throws IOException
Description copied from interface:CodecHandlerDecodes the given page buffer.- Specified by:
decodePagein interfaceCodecHandler- Parameters:
inPage- the page to be decodedoutPage- the decoded page. ifCodecHandler.canDecodeInline()istrue, this will be the same buffer as inPage.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:CodecHandlerEncodes 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:
encodePagein interfaceCodecHandler- Parameters:
page- the page to be encoded, should not be modifiedpageNumber- the page number of the given pagepageOffset- 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
-
-