Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 5.3.28
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sleepycat.db
Interface BtreeCompressor

    public interface BtreeCompressor

An interface specifying how Btree compression works.

Method Summary
`boolean` | `compress(Database db, DatabaseEntry prevKey, DatabaseEntry prevData, DatabaseEntry key, DatabaseEntry data, DatabaseEntry dest)` The application-specific Btree compress callback.
`boolean` | `decompress(Database db, DatabaseEntry prevKey, DatabaseEntry prevData, DatabaseEntry compressed, DatabaseEntry key, DatabaseEntry data)` The application-specific Btree decompress callback.

Method Detail

### compress

    boolean compress(Database db,
                     DatabaseEntry prevKey,
                     DatabaseEntry prevData,
                     DatabaseEntry key,
                     DatabaseEntry data,
                     DatabaseEntry dest)

  The application-specific Btree compress callback.

  The compress function must return true on success and false on failure. If the compressed data is larger than dest.getUserBufferLength() the function should set the required length in the dest DatabaseEntry via setSize and return false.

  Parameters:
    `db` - The enclosing database handle.
    `prevKey` - A database entry representing the previous key from the compressed stream.
    `prevData` - A database entry representing the data matching prevKey key entry.
    `key` - A database entry representing representing the application supplied key.
    `data` - A database entry representing representing the application supplied data.
    `dest` - A database entry representing the data stored in the tree. This is where the callback function should write the compressed data.

### decompress

    boolean decompress(Database db,
                       DatabaseEntry prevKey,
                       DatabaseEntry prevData,
                       DatabaseEntry compressed,
                       DatabaseEntry key,
                       DatabaseEntry data)

  The application-specific Btree decompress callback.

  The decompress function must return true on success, and false on failure.

  Parameters:
    `db` - The enclosing database handle.
    `prevKey` - A database entry representing the previous key from the compressed stream.
    `prevData` - A database entry representing the data matching prevKey key entry.
    `compressed` - A database entry representing the data stored in the tree. That is the compressed data.
    `key` - A database entry representing representing the application supplied key.
    `data` - A database entry representing representing the application supplied data.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 5.3.28
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 1996, 2013 Oracle and/or its affiliates. All rights reserved.