Examples of PrependingInputStream


Examples of mireka.filter.spf.PrependingInputStream

    private byte[] expected = new byte[] { 1, 2, 3, 4, 5, 6 };
    private InputStream bodyStream = new ByteArrayInputStream(body);

    @Test
    public void testSingleReads() throws IOException {
        PrependingInputStream stream =
                new PrependingInputStream(header, bodyStream);
        byte[] actual = readByBytes(stream);
        assertArrayEquals(expected, actual);
    }
View Full Code Here

Examples of mireka.filter.spf.PrependingInputStream

        return actual;
    }

    @Test
    public void testBlockRead() throws IOException {
        PrependingInputStream stream =
                new PrependingInputStream(header, bodyStream);
        byte[] buffer = new byte[100];
        int cRead = stream.read(buffer);

        assertTrue(cRead != -1);
        byte[] actual = Arrays.copyOf(buffer, cRead);
        assertArrayEquals(expected, actual);
    }
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.