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

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


    }

    public void testLengthNoInitialBlocksWriteSingleByte() {
        BlockedByteArray src = new BlockedByteArray();
        assertEquals(0, src.length());
        src.writeByte(0, (byte)1);
        assertEquals(1, src.length());
        for (int i=0; i < 66*1024; i++) {
            src.writeByte(1 + i, (byte)i);
            assertEquals(i +2, src.length());
        }
View Full Code Here


        BlockedByteArray src = new BlockedByteArray();
        assertEquals(0, src.length());
        src.writeByte(0, (byte)1);
        assertEquals(1, src.length());
        for (int i=0; i < 66*1024; i++) {
            src.writeByte(1 + i, (byte)i);
            assertEquals(i +2, src.length());
        }
    }

    public void testLengthNoInitialBlocksWriteMultipleBytes4K() {
View Full Code Here

        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());
    }

    public void testLengthNoInitialBlocksWriteMultipleBytes4KPlussAFew() {
        BlockedByteArray src = new BlockedByteArray();
View Full Code Here

        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());
    }

    public void testReadArray()
            throws IOException {
View Full Code Here

    public void testLength()
            throws IOException {
        BlockedByteArray src = createBlockedByteArray(0);
        assertEquals(0L, src.length());
        src.writeByte(0L, (byte)1);
        assertEquals(1L, src.length());
        src.writeByte(0L, (byte)1);
        assertEquals(1L, src.length());
        src.writeByte(9L, (byte)2);
        assertEquals(10L, src.length());
View Full Code Here

            throws IOException {
        BlockedByteArray src = createBlockedByteArray(0);
        assertEquals(0L, src.length());
        src.writeByte(0L, (byte)1);
        assertEquals(1L, src.length());
        src.writeByte(0L, (byte)1);
        assertEquals(1L, src.length());
        src.writeByte(9L, (byte)2);
        assertEquals(10L, src.length());
        byte[] bytes = new byte[4096];
        Arrays.fill(bytes, (byte)7);
View Full Code Here

        assertEquals(0L, src.length());
        src.writeByte(0L, (byte)1);
        assertEquals(1L, src.length());
        src.writeByte(0L, (byte)1);
        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());
View Full Code Here

    }

    public void testLengthNoInitialBlocksWriteSingleByte() {
        BlockedByteArray src = new BlockedByteArray();
        assertEquals(0, src.length());
        src.writeByte(0, (byte)1);
        assertEquals(1, src.length());
        for (int i=0; i < 66*1024; i++) {
            src.writeByte(1 + i, (byte)i);
            assertEquals(i +2, src.length());
        }
View Full Code Here

        BlockedByteArray src = new BlockedByteArray();
        assertEquals(0, src.length());
        src.writeByte(0, (byte)1);
        assertEquals(1, src.length());
        for (int i=0; i < 66*1024; i++) {
            src.writeByte(1 + i, (byte)i);
            assertEquals(i +2, src.length());
        }
    }

    public void testLengthNoInitialBlocksWriteMultipleBytes4K() {
View Full Code Here

        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());
    }

    public void testLengthNoInitialBlocksWriteMultipleBytes4KPlussAFew() {
        BlockedByteArray src = new BlockedByteArray();
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.