Package org.xtreemfs.foundation.buffer

Examples of org.xtreemfs.foundation.buffer.ReusableBuffer.limit()


            // reset the old checksum to 0, before calculating a new one
            buf.position(Integer.SIZE / 8);
            buf.putInt(0);
            buf.position(0);
           
            csumAlgo.update(buf.array(), 0, buf.limit());
            int cPos = buf.position();
           
            // write the checksum to the buffer
            buf.position(Integer.SIZE / 8);
            buf.putInt((int) csumAlgo.getValue());
View Full Code Here


       
        int entries = keys.size();
        int keysOffset = CompressedBlockReader.PREFIX_OFFSET + this.prefix.length;
        int valsOffset = keysOffset + keyBuf.limit();
       
        ByteBuffer returnBuf = ByteBuffer.wrap(new byte[valsOffset + valBuf.limit()]);
        /*
         * the header consist of 4 : ptr to vals 4 : ptr to keys 4 : number of
         * entries 4 : -1 => variable keys, or n => length of fixed size keys 4
         * : -1 => variable values, or n => length of fixed size values k :
         * prefix ... start of keys
View Full Code Here

        returnBuf.putInt(valsOffset);
        returnBuf.putInt(keysOffset);
        returnBuf.putInt(entries);
        returnBuf.putInt(varLenKeys ? -1 : entries == 0 ? 0 : (keyBuf.limit() / entries));
        returnBuf.putInt(varLenVals ? -1 : entries == 0 ? 0 : (valBuf.limit() / entries));
       
        if (this.prefix.length > 0)
            returnBuf.put(this.prefix);
       
        returnBuf.put(keyBuf.getBuffer());
View Full Code Here

                    int pos = bufferPos + length;
                   
                    // prepare view buffer
                    view = buffer.createViewBuffer();
                    view.position(bufferPos);
                    view.limit(pos);
                   
                    // reset buffer position
                    buffer.position(pos);
                   
                    return InsertRecordGroup.deserialize(view);
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.