Package org.grails.buffer

Examples of org.grails.buffer.StreamByteBuffer.reset()


        StreamByteBuffer byteBuffer = new StreamByteBuffer(1024, StreamByteBuffer.ReadMode.RETAIN_AFTER_READING);
        PrintWriter pw=new PrintWriter(new OutputStreamWriter(byteBuffer.getOutputStream(),"UTF-8"));
        pw.print(TEST_STRING);
        pw.close();
        assertEquals(TEST_STRING, byteBuffer.readAsString("UTF-8"));
        byteBuffer.reset();
        // call a second time to test if the RETAIN_AFTER_READING mode works as expected
        assertEquals(TEST_STRING, byteBuffer.readAsString("UTF-8"));
    }

    public void testToInputStream() throws IOException {
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.