Package org.msgpack.core.buffer

Examples of org.msgpack.core.buffer.OutputStreamBufferOutput


import static org.junit.Assert.assertEquals;

public class MessagePackParserTest extends MessagePackDataformatTestBase {
    @Test
    public void testParserShouldReadObject() throws IOException {
        MessagePacker packer = new MessagePacker(new OutputStreamBufferOutput(out));
        packer.packMapHeader(8);
        // #1
        packer.packString("str");
        packer.packString("foobar");
        // #2
View Full Code Here


        assertEquals(0x3FF, bitmap);
    }

    @Test
    public void testParserShouldReadArray() throws IOException {
        MessagePacker packer = new MessagePacker(new OutputStreamBufferOutput(out));
        packer.packArrayHeader(10);
        // #1
        packer.packArrayHeader(3);
        {
            packer.packLong(Long.MAX_VALUE);
View Full Code Here

    }

    public MessagePackGenerator(int features, ObjectCodec codec, OutputStream out) throws IOException {
        super(features, codec);
        MessagePacker messagePacker = messagePackersHolder.get();
        OutputStreamBufferOutput messageBufferOutput = messageBufferOutputHolder.get();
        if (messageBufferOutput == null) {
            messageBufferOutput = new OutputStreamBufferOutput(out);
        }
        else {
            messageBufferOutput.reset(out);
        }
        messageBufferOutputHolder.set(messageBufferOutput);

        if (messagePacker == null) {
            messagePacker = new MessagePacker(messageBufferOutput);
View Full Code Here

TOP

Related Classes of org.msgpack.core.buffer.OutputStreamBufferOutput

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.