org.apache.directory.server.core.partition.impl.btree.jdbm
Class BTreeRedirectMarshaller

java.lang.Object
  extended by org.apache.directory.server.core.partition.impl.btree.jdbm.BTreeRedirectMarshaller
All Implemented Interfaces:
Marshaller<BTreeRedirect>

public class BTreeRedirectMarshaller
extends java.lang.Object
implements Marshaller<BTreeRedirect>

Serializes and deserializes a BTreeRedirect object to and from a byte[] representation. The serialized form is a fixed size byte array of length 9. The first byte contains the magic number of value 1 for this kind of object and the last 8 bytes encode the record identifier as a long for the BTree.

Version:
$Rev$
Author:
Apache Directory Project

Field Summary
static BTreeRedirectMarshaller INSTANCE
          a reusable instance of this Marshaller
 
Constructor Summary
BTreeRedirectMarshaller()
           
 
Method Summary
 BTreeRedirect deserialize(byte[] bites)
           
static boolean isRedirect(byte[] bites)
          Checks to see if a byte[] contains a redirect.
 byte[] serialize(BTreeRedirect redirect)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final BTreeRedirectMarshaller INSTANCE
a reusable instance of this Marshaller

Constructor Detail

BTreeRedirectMarshaller

public BTreeRedirectMarshaller()
Method Detail

serialize

public final byte[] serialize(BTreeRedirect redirect)
                       throws java.io.IOException
Specified by:
serialize in interface Marshaller<BTreeRedirect>
Throws:
java.io.IOException
See Also:
Marshaller.serialize(Object)

deserialize

public final BTreeRedirect deserialize(byte[] bites)
                                throws java.io.IOException
Specified by:
deserialize in interface Marshaller<BTreeRedirect>
Throws:
java.io.IOException
See Also:
Marshaller.deserialize(byte[])

isRedirect

public static boolean isRedirect(byte[] bites)
Checks to see if a byte[] contains a redirect.

Parameters:
bites - the bites to check for a redirect
Returns:
true if bites contain BTreeRedirect, false otherwise


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.