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

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


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

            return null;
        }

        if ( in.length < length + 4 + start )
        {
            throw new SerializerCreationException( "Cannot extract a String from a buffer with not enough bytes" );
        }

        return Strings.utf8ToString( in, start + 4, length );
    }
View Full Code Here

            return null;
        }

        if ( in.length < length + start )
        {
            throw new SerializerCreationException( "Cannot extract a String from a buffer with not enough bytes" );
        }

        return Strings.utf8ToString( in, start + 4, length );
    }
View Full Code Here

                    buffer[start + 3] = ( byte ) ( strBytes.length );
                }
                catch ( UnsupportedEncodingException uee )
                {
                    // if this happens something is really strange
                    throw new SerializerCreationException( uee );
                }
        }

        return buffer;
    }
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.