org.apache.directory.shared.ldap.util
Class AttributeSerializerUtils

java.lang.Object
  extended by org.apache.directory.shared.ldap.util.AttributeSerializerUtils

public class AttributeSerializerUtils
extends java.lang.Object

Serializes a attributes object using a custom serialization mechanism so we do not have to rely on Java Serialization which is much more costly.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Constructor Summary
AttributeSerializerUtils()
           
 
Method Summary
static java.lang.Object deserialize(byte[] buf)
           
static org.apache.directory.shared.ldap.util.AttributeSerializerUtils.DeserializedAttribute deserialize(byte[] buf, int offset)
          Deserializes an attribute from the custom serialization structure.
static byte[] serialize(java.lang.Object obj)
          Serializes an attribute using the following structure: [id-length][id-bytes][is-binary][length0][value0]...[lengthN][valueN] Here the id-length is the 4 byte int value of the length of bytes for the id string bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeSerializerUtils

public AttributeSerializerUtils()
Method Detail

deserialize

public static final java.lang.Object deserialize(byte[] buf)

deserialize

public static final org.apache.directory.shared.ldap.util.AttributeSerializerUtils.DeserializedAttribute deserialize(byte[] buf,
                                                                                                                     int offset)
Deserializes an attribute from the custom serialization structure.

See Also:
jdbm.helper.Serializer#deserialize(byte[])

serialize

public static final byte[] serialize(java.lang.Object obj)
                              throws java.io.IOException
Serializes an attribute using the following structure: [id-length][id-bytes][is-binary][length0][value0]...[lengthN][valueN] Here the id-length is the 4 byte int value of the length of bytes for the id string bytes. The id-bytes are the bytes for the id string. The is-binary byte is a true or false for whether or not the values are byte[] or String types. Following this is an array of length-value tuples for the values of the Attributes.

Throws:
java.io.IOException


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.