Package org.nustaq.offheap.bytez

Examples of org.nustaq.offheap.bytez.BasicBytez


    @Override
    public void ensureFree(int bytes) throws IOException {
        if ( buffout.length() <= pos+bytes) {
            if ( autoResize ) {
                BasicBytez newbytez = buffout.newInstance(Math.max(pos + bytes, buffout.length() * 2));
                buffout.copyTo(newbytez, 0, 0, pos);
                // debug
                //            for ( int i = 0; i < pos; i++) {
                //                if ( buffout.get(i) != newbytez.get(i) ) {
                //                    throw new RuntimeException("error");
View Full Code Here


                tmp = new byte[toRead];
            }
            int read = inputStream.read(tmp, 0, toRead);
            if ( read > 0 ) {
                if ( input.length() < pos+read ) {
                    BasicBytez bytez = input.newInstance(2*(pos + read));
                    input.copyTo(bytez,0,0,pos);
                    input = (HeapBytez) bytez;
                }
                input.set(pos,tmp,0,read);
                readUntil = pos+read;
View Full Code Here

        }
        // suboptimal method for non heap backing
        if ( input.getClass() == HeapBytez.class ) {
            ((HeapBytez)input).setBase(bytes,0,len);
        } else {
            BasicBytez newBytez = input.newInstance(len);
            newBytez.set(0,bytes,0,len);
        }
        pos = 0;
        clnames.clear();
    }
View Full Code Here

TOP

Related Classes of org.nustaq.offheap.bytez.BasicBytez

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.