Package freenet.support.api

Examples of freenet.support.api.RandomAccessBuffer.pread()


            int toRead = maxRead == 1 ? 1 : r.nextInt(maxRead-1)+1;
            byte[] buf = new byte[toRead];
            for(int i=0;i<buf.length;i++) buf[i] = f.getByte(i+x);
            raf.pwrite(x, buf, 0, toRead);
            for(int i=0;i<buf.length;i++) buf[i] = (byte)~buf[i];
            raf.pread(x, buf, 0, toRead);
            for(int i=0;i<buf.length;i++) assertEquals(buf[i], f.getByte(i+x));
            x += toRead;
        }
        // Read
        while(x < sz) {
View Full Code Here


        // Read
        while(x < sz) {
            int maxRead = (int)Math.min(BUFFER_SIZE, sz - x);
            int toRead = r.nextInt(maxRead-1)+1;
            byte[] buf = new byte[toRead];
            raf.pread(x, buf, 0, toRead);
            for(int i=0;i<buf.length;i++) assertEquals(buf[i], f.getByte(i+x));
            x += toRead;
        }
        x = 0;
        raf.close();
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.