Examples of BufferHandler


Examples of org.apache.directory.mavibot.btree.serializer.BufferHandler

     @return An instance of a Dn object
     *  @throws IOException if we can't deserialize the Dn
     */
    public Dn deserialize( ByteBuffer buffer ) throws IOException
    {
        return deserialize( new BufferHandler( buffer.array() ) );
    }
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.BufferHandler

     @return An instance of a Dn object
     *  @throws IOException if we can't deserialize the Dn
     */
    public Dn deserialize( ByteBuffer buffer ) throws IOException
    {
        return deserialize( new BufferHandler( buffer.array() ) );
    }
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.BufferHandler

        FileChannel channel =
            new RandomAccessFile( journal, "rw" ).getChannel();
        ByteBuffer buffer = ByteBuffer.allocate( 65536 );

        BufferHandler bufferHandler = new BufferHandler( channel, buffer );

        // Loop on all the elements, store them in lists atm
        try
        {
            while ( true )
            {
                // Read the type
                byte[] type = bufferHandler.read( 1 );

                if ( type[0] == Modification.ADDITION )
                {
                    // Read the key
                    K key = keySerializer.deserialize( bufferHandler );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.BufferHandler

        FileChannel channel =
            new RandomAccessFile( file, "rw" ).getChannel();
        ByteBuffer buffer = ByteBuffer.allocate( 65536 );

        BufferHandler bufferHandler = new BufferHandler( channel, buffer );

        long nbElems = LongSerializer.deserialize( bufferHandler.read( 8 ) );
        btreeHeader.setNbElems( nbElems );

        // Prepare a list of keys and values read from the disk
        //List<K> keys = new ArrayList<K>();
        //List<V> values = new ArrayList<V>();
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.BufferHandler

        FileChannel channel =
            new RandomAccessFile( journal, "rw" ).getChannel();
        ByteBuffer buffer = ByteBuffer.allocate( 65536 );

        BufferHandler bufferHandler = new BufferHandler( channel, buffer );

        // Loop on all the elements, store them in lists atm
        try
        {
            while ( true )
            {
                // Read the type
                byte[] type = bufferHandler.read( 1 );

                if ( type[0] == Modification.ADDITION )
                {
                    // Read the key
                    K key = keySerializer.deserialize( bufferHandler );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.BufferHandler

        FileChannel channel =
            new RandomAccessFile( file, "rw" ).getChannel();
        ByteBuffer buffer = ByteBuffer.allocate( 65536 );

        BufferHandler bufferHandler = new BufferHandler( channel, buffer );

        long nbElems = LongSerializer.deserialize( bufferHandler.read( 8 ) );

        // desactivate the journal while we load the file
        boolean isJournalActivated = withJournal;

        withJournal = false;
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.BufferHandler

        assertEquals( 12, result.length );

        assertEquals( 1L, ( long ) LongSerializer.deserialize( result ) );
        assertNull( StringSerializer.deserialize( result, 8 ) );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );

        // ------------------------------------------------------------------
        value = new RevisionName( 0L, "" );
        result = serializer.serialize( value );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );

        // ------------------------------------------------------------------
        value = new RevisionName( 0L, "L\u00E9charny" );
        result = serializer.serialize( value );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );
    }
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.BufferHandler

        assertEquals( 12, result.length );

        assertEquals( 1L, ( long ) LongSerializer.deserialize( result ) );
        assertNull( StringSerializer.deserialize( result, 8 ) );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );

        // ------------------------------------------------------------------
        value = new RevisionName( 0L, "" );
        result = serializer.serialize( value );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );

        // ------------------------------------------------------------------
        value = new RevisionName( 0L, "L\u00E9charny" );
        result = serializer.serialize( value );

        assertEquals( value, serializer.deserialize( new BufferHandler( result ) ) );
    }
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.BufferHandler

        FileChannel channel =
            new RandomAccessFile( journal, "rw" ).getChannel();
        ByteBuffer buffer = ByteBuffer.allocate( 65536 );

        BufferHandler bufferHandler = new BufferHandler( channel, buffer );

        // Loop on all the elements, store them in lists atm
        try
        {
            while ( true )
            {
                // Read the type
                byte[] type = bufferHandler.read( 1 );

                if ( type[0] == Modification.ADDITION )
                {
                    // Read the key
                    K key = keySerializer.deserialize( bufferHandler );
View Full Code Here

Examples of org.apache.directory.mavibot.btree.serializer.BufferHandler

        FileChannel channel =
            new RandomAccessFile( file, "rw" ).getChannel();
        ByteBuffer buffer = ByteBuffer.allocate( 65536 );

        BufferHandler bufferHandler = new BufferHandler( channel, buffer );

        long nbElems = LongSerializer.deserialize( bufferHandler.read( 8 ) );
        btreeHeader.setNbElems( nbElems );

        // Prepare a list of keys and values read from the disk
        //List<K> keys = new ArrayList<K>();
        //List<V> values = new ArrayList<V>();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.