package com.dbxml.db.common.btree;

/*
 * dbXML - Native XML Database
 * Copyright (C) 1999-2004  The dbXML Group, L.L.C.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Id: PageFilter.java,v 1.2 2004/06/16 17:36:56 bradford Exp $
 */

import com.dbxml.util.Configurable;
import java.io.IOException;

/**
 * PageFilter implements a global Page filter for the database.  All files
 * that derive from the Paged interface will have their pages encoded
 * and decoded using the methods of an implementation of this interface.
 *
 * Implementations of this interface are chained and executed in their
 * configured order for writes, and reverse order for reads.
 */

public interface PageFilter extends Configurable {
   int getPadding();

   byte[] encode(byte[] buffer, int maxSize) throws IOException;

   byte[] decode(byte[] buffer, int maxSize) throws IOException;
}

