Package org.apache.mina.util

Examples of org.apache.mina.util.ByteBufferOutputStream


        return serialize(message).remaining();
    }

    private ByteBuffer serialize(OUT message) {
        if (message != lastObject) {
            ByteBufferOutputStream ebbosa = new ByteBufferOutputStream();
            ebbosa.setElastic(true);
            try {
                ObjectOutputStream oos = new ObjectOutputStream(ebbosa);
                oos.writeObject(message);
                oos.close();
                lastObject = message;
                lastSerialized = ebbosa.getByteBuffer();
            } catch (IOException e) {
                throw new IllegalStateException("Serialization exception", e);
            }
        }
        return lastSerialized;
View Full Code Here


        return list;
    }

    @Override
    protected ByteBuffer delimitWithOriginal() throws IOException {
        ByteBufferOutputStream bbos = new ByteBufferOutputStream();
        bbos.setElastic(true);

        for (Person p : getObjects()) {
            p.writeDelimitedTo(bbos);
        }
        return bbos.getByteBuffer();
    }
View Full Code Here

TOP

Related Classes of org.apache.mina.util.ByteBufferOutputStream

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.