Package org.apache.jute

Examples of org.apache.jute.BinaryOutputArchive.writeInt()


                // Construct a connection request
                ConnectRequest conReq = new ConnectRequest(0, 0,
                        10000, 0, "password".getBytes());
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos);
                boa.writeInt(-1, "len");
                conReq.serialize(boa, "connect");
                baos.close();
                ByteBuffer bb = ByteBuffer.wrap(baos.toByteArray());
                bb.putInt(bb.capacity() - 4);
                bb.rewind();
View Full Code Here


        public void createBB() {
            try {
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                BinaryOutputArchive boa = BinaryOutputArchive.getArchive(baos);
                boa.writeInt(-1, "len"); // We'll fill this in later
                if (requestHeader != null) {
                    requestHeader.serialize(boa, "header");
                }
                if (request instanceof ConnectRequest) {
                    request.serialize(boa, "connect");
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.