Package play.mvc.Results

Examples of play.mvc.Results.ByteChunks


    @Test
    public void testByteChunks() throws Throwable {
        final TestChannel<byte[]> testChannel = new TestChannel<byte[]>();
        final Chunks.Out<byte[]> out = new Chunks.Out<byte[]>(testChannel, new ArrayList<F.Callback0>());
        Chunks<byte[]> chunks = new ByteChunks() {
            @Override
            public void onReady(Chunks.Out<byte[]> out) {
                out.write("a".getBytes());
                out.write("b".getBytes());
                out.close();
            }
        };
        chunks.onReady(out);

        testChannel.expect("a".getBytes(), arraysEqual);
        testChannel.expect("b".getBytes(), arraysEqual);
        testChannel.expectEOF();
        testChannel.expectEnd();
View Full Code Here

TOP

Related Classes of play.mvc.Results.ByteChunks

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.