Package org.grails.web.util

Examples of org.grails.web.util.BoundedCharsAsEncodedBytesCounter.update()


    private static final String TEST_STRING = "Hello \u00f6\u00e4\u00e5\u00d6\u00c4\u00c5!";

    public void testCalculation() throws Exception {
        BoundedCharsAsEncodedBytesCounter counter = new BoundedCharsAsEncodedBytesCounter(1024, "ISO-8859-1");
        counter.getCountingWriter();
        counter.update(TEST_STRING);
        assertEquals(13, counter.size());
        assertEquals(13, TEST_STRING.getBytes("ISO-8859-1").length);
        counter.update(TEST_STRING);
        assertEquals(26, counter.size());
    }
View Full Code Here


        BoundedCharsAsEncodedBytesCounter counter = new BoundedCharsAsEncodedBytesCounter(1024, "ISO-8859-1");
        counter.getCountingWriter();
        counter.update(TEST_STRING);
        assertEquals(13, counter.size());
        assertEquals(13, TEST_STRING.getBytes("ISO-8859-1").length);
        counter.update(TEST_STRING);
        assertEquals(26, counter.size());
    }
}
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.