public void testDouble() throws Exception
    {
        for (double i : double_targets)
        {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            LinkedBuffer lb = new LinkedBuffer(BUF_SIZE);
            WriteSession session = new WriteSession(lb, out);
            StreamedStringSerializer.writeDouble(i, session, lb);
            LinkedBuffer.writeTo(out, lb);

            ByteArrayOutputStream out2 = new ByteArrayOutputStream();
            LinkedBuffer lb2 = new LinkedBuffer(NUM_BUF_SIZE);
            WriteSession session2 = new WriteSession(lb2, out2);
            StreamedStringSerializer.writeDouble(i, session2, lb2);
            LinkedBuffer.writeTo(out2, lb2);

            byte[] buffered = out.toByteArray();
            byte[] buffered_needed_to_flush = out2.toByteArray();
            byte[] builtin = STRING.ser(Double.toString(i));

            assertEquals(builtin, buffered);
            assertEquals(builtin, buffered_needed_to_flush);
        }
    }
Tests for streaming UTF-8 Encoding

@author David Yu
@created Sep 18, 2010
protostuff-api/src/test/java/io/protostuff/StreamedStringSerializerTest.java