Package net.sf.cindy

Examples of net.sf.cindy.Buffer.asByteBuffer()


            }

            protected void read() throws IOException {
                while (true) {
                    Buffer buffer = BufferFactory.allocate(getReadPacketSize());
                    ByteBuffer byteBuffer = buffer.asByteBuffer();

                    try {
                        SocketAddress address = channel.receive(byteBuffer);
                        if (address == null) {
                            buffer.release();
View Full Code Here


                Buffer buffer = packet.getContent();
                int writeCount = 0;
                if (packet.getAddress() == null) // connected
                    writeCount = buffer.write(channel);
                else {
                    writeCount = channel.send(buffer.asByteBuffer(), packet
                            .getAddress());
                    buffer.skip(writeCount);
                }
                return writeCount != 0;
            }
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.