Package org.apache.derby.impl.io.vfmem

Examples of org.apache.derby.impl.io.vfmem.BlockedByteArray.writeBytes()


    public void testLengthNoInitialBlocksWriteMultipleBytes4K() {
        BlockedByteArray src = new BlockedByteArray();
        byte[] buf = new byte[4*1024];
        Arrays.fill(buf, (byte)1);
        src.writeBytes(0, buf, 0, buf.length);
        assertEquals(buf.length, src.length());
        Arrays.fill(buf, (byte)2);
        src.writeBytes(buf.length, buf, 0, buf.length);
        assertEquals(2 * buf.length, src.length());
        src.writeByte(69, (byte)8);
View Full Code Here


        byte[] buf = new byte[4*1024];
        Arrays.fill(buf, (byte)1);
        src.writeBytes(0, buf, 0, buf.length);
        assertEquals(buf.length, src.length());
        Arrays.fill(buf, (byte)2);
        src.writeBytes(buf.length, buf, 0, buf.length);
        assertEquals(2 * buf.length, src.length());
        src.writeByte(69, (byte)8);
        assertEquals(2 * buf.length, src.length());
    }

View Full Code Here

    public void testLengthNoInitialBlocksWriteMultipleBytes4KPlussAFew() {
        BlockedByteArray src = new BlockedByteArray();
        byte[] buf = new byte[4*1024+37];
        Arrays.fill(buf, (byte)1);
        src.writeBytes(0, buf, 0, buf.length);
        assertEquals(buf.length, src.length());
        Arrays.fill(buf, (byte)2);
        src.writeBytes(buf.length, buf, 0, buf.length);
        assertEquals(2 * buf.length, src.length());
        src.writeByte(54, (byte)7);
View Full Code Here

        byte[] buf = new byte[4*1024+37];
        Arrays.fill(buf, (byte)1);
        src.writeBytes(0, buf, 0, buf.length);
        assertEquals(buf.length, src.length());
        Arrays.fill(buf, (byte)2);
        src.writeBytes(buf.length, buf, 0, buf.length);
        assertEquals(2 * buf.length, src.length());
        src.writeByte(54, (byte)7);
        assertEquals(2 * buf.length, src.length());
    }

View Full Code Here

        assertEquals(1L, src.length());
        src.writeByte(9L, (byte)2);
        assertEquals(10L, src.length());
        byte[] bytes = new byte[4096];
        Arrays.fill(bytes, (byte)7);
        src.writeBytes(0L, bytes, 0, bytes.length);
        assertEquals(bytes.length, src.length());
        src.writeBytes(bytes.length, bytes, 0, bytes.length);
        assertEquals(2*bytes.length, src.length());

        // Test setLength
View Full Code Here

        assertEquals(10L, src.length());
        byte[] bytes = new byte[4096];
        Arrays.fill(bytes, (byte)7);
        src.writeBytes(0L, bytes, 0, bytes.length);
        assertEquals(bytes.length, src.length());
        src.writeBytes(bytes.length, bytes, 0, bytes.length);
        assertEquals(2*bytes.length, src.length());

        // Test setLength
        src.setLength(55555);
        assertEquals(55555, src.length());
View Full Code Here

        InputStream src = new LoopingAlphabetStream(length);
        byte[] buf = new byte[4*1024];
        long pos = 0;
        while (pos < length) {
            int readFromSrc = src.read(buf);
            pos += data.writeBytes(pos, buf, 0, readFromSrc);
        }
        return data;
    }
}
View Full Code Here

    public void testLengthNoInitialBlocksWriteMultipleBytes4K() {
        BlockedByteArray src = new BlockedByteArray();
        byte[] buf = new byte[4*1024];
        Arrays.fill(buf, (byte)1);
        src.writeBytes(0, buf, 0, buf.length);
        assertEquals(buf.length, src.length());
        Arrays.fill(buf, (byte)2);
        src.writeBytes(buf.length, buf, 0, buf.length);
        assertEquals(2 * buf.length, src.length());
        src.writeByte(69, (byte)8);
View Full Code Here

        byte[] buf = new byte[4*1024];
        Arrays.fill(buf, (byte)1);
        src.writeBytes(0, buf, 0, buf.length);
        assertEquals(buf.length, src.length());
        Arrays.fill(buf, (byte)2);
        src.writeBytes(buf.length, buf, 0, buf.length);
        assertEquals(2 * buf.length, src.length());
        src.writeByte(69, (byte)8);
        assertEquals(2 * buf.length, src.length());
    }

View Full Code Here

    public void testLengthNoInitialBlocksWriteMultipleBytes4KPlussAFew() {
        BlockedByteArray src = new BlockedByteArray();
        byte[] buf = new byte[4*1024+37];
        Arrays.fill(buf, (byte)1);
        src.writeBytes(0, buf, 0, buf.length);
        assertEquals(buf.length, src.length());
        Arrays.fill(buf, (byte)2);
        src.writeBytes(buf.length, buf, 0, buf.length);
        assertEquals(2 * buf.length, src.length());
        src.writeByte(54, (byte)7);
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.