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

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


     */
    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

     */
    public static char[] 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 char[] fromBytes( byte[] in, int start )
    {
        if ( ( in == null ) || ( in.length - start < 4 ) )
        {
            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

     */
    public char[] fromBytes( 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 < 1 + start ) )
        {
            throw new SerializerCreationException( "Cannot extract a Byte from a buffer with not enough bytes" );
        }

        return in[start];
    }
View Full Code Here

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

        return in[start];
    }
View Full Code Here

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

        long result = ( ( long ) in[start] << 56 ) +
            ( ( in[start + 1] & 0xFFL ) << 48 ) +
            ( ( in[start + 2] & 0xFFL ) << 40 ) +
View Full Code Here

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

        long result = ( ( long ) in[start] << 56 ) +
            ( ( in[start + 1] & 0xFFL ) << 48 ) +
            ( ( in[start + 2] & 0xFFL ) << 40 ) +
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.