Package org.apache.directory.mavibot.btree.exception

Examples of org.apache.directory.mavibot.btree.exception.SerializerCreationException


    @Override
    public byte[] serialize( RevisionName revisionName )
    {
        if ( revisionName == null )
        {
            throw new SerializerCreationException( "The revisionName instance should not be null " );
        }

        byte[] result = null;

        if ( revisionName.getName() != null )
View Full Code Here


     */
    public static Boolean deserialize( byte[] in, int start )
    {
        if ( ( in == null ) || ( in.length < 1 + start ) )
        {
            throw new SerializerCreationException( "Cannot extract a Boolean from a buffer with not enough bytes" );
        }

        return in[start] == 0x01;
    }
View Full Code Here

     */
    public Boolean fromBytes( byte[] in, int start )
    {
        if ( ( in == null ) || ( in.length < 1 + start ) )
        {
            throw new SerializerCreationException( "Cannot extract a Boolean from a buffer with not enough bytes" );
        }

        return in[start] == 0x01;
    }
View Full Code Here

     */
    public static Character deserialize( byte[] in, int start )
    {
        if ( ( in == null ) || ( in.length < 2 + start ) )
        {
            throw new SerializerCreationException( "Cannot extract a Character from a buffer with not enough bytes" );
        }

        return Character.valueOf( ( char ) ( ( in[start] << 8 ) +
            ( in[start + 1] & 0xFF ) ) );
    }
View Full Code Here

     */
    public Character fromBytes( byte[] in, int start )
    {
        if ( ( in == null ) || ( in.length < 2 + start ) )
        {
            throw new SerializerCreationException( "Cannot extract a Character from a buffer with not enough bytes" );
        }

        return Character.valueOf( ( char ) ( ( in[start] << 8 ) +
            ( in[start + 1] & 0xFF ) ) );
    }
View Full Code Here

    /* no qualifier*/static NameRevision deserialize( byte[] in, int start )
    {
        // The buffer must be 8 bytes plus 4 bytes long (the revision is a long, and the name is a String
        if ( ( in == null ) || ( in.length < 12 + start ) )
        {
            throw new SerializerCreationException( "Cannot extract a NameRevision from a buffer with not enough bytes" );
        }

        long revision = LongSerializer.deserialize( in, start );
        String name = StringSerializer.deserialize( in, 8 + start );

View Full Code Here

    public NameRevision fromBytes( byte[] in, int start )
    {
        // The buffer must be 8 bytes plus 4 bytes long (the revision is a long, and the name is a String
        if ( ( in == null ) || ( in.length < 12 + start ) )
        {
            throw new SerializerCreationException( "Cannot extract a NameRevision from a buffer with not enough bytes" );
        }

        long revision = LongSerializer.deserialize( in, start );
        String name = StringSerializer.deserialize( in, 8 + start );
View Full Code Here

    @Override
    public byte[] serialize( NameRevision revisionName )
    {
        if ( revisionName == null )
        {
            throw new SerializerCreationException( "The revisionName instance should not be null " );
        }

        byte[] result = null;

        if ( revisionName.getName() != null )
View Full Code Here

     */
    public static byte[] deserialize( byte[] in )
    {
        if ( ( in == null ) || ( in.length < 4 ) )
        {
            throw new SerializerCreationException( "Cannot extract a byte[] from a buffer with not enough bytes" );
        }

        int len = IntSerializer.deserialize( in );

        switch ( len )
View Full Code Here

     */
    public static byte[] deserialize( byte[] in, int start )
    {
        if ( ( in == null ) || ( in.length < 4 + start ) )
        {
            throw new SerializerCreationException( "Cannot extract a byte[] from a buffer with not enough bytes" );
        }

        int len = IntSerializer.deserialize( in, start );

        switch ( len )
View Full Code Here

TOP

Related Classes of org.apache.directory.mavibot.btree.exception.SerializerCreationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.