Package com.google.code.hs4j.network.buffer

Examples of com.google.code.hs4j.network.buffer.IoBuffer.remaining()


    public IoBuffer encode(Object message, Session session) {
      final IoBuffer msgBuffer = (IoBuffer) message;
      if (msgBuffer == null) {
        return null;
      }
      if (msgBuffer.remaining() == 0) {
        return EMPTY_BUFFER;
      }
      byte[] bytes = new byte[msgBuffer.remaining()];
      msgBuffer.get(bytes);
      IoBuffer result = IoBuffer.allocate(bytes.length,
View Full Code Here


        return null;
      }
      if (msgBuffer.remaining() == 0) {
        return EMPTY_BUFFER;
      }
      byte[] bytes = new byte[msgBuffer.remaining()];
      msgBuffer.get(bytes);
      IoBuffer result = IoBuffer.allocate(bytes.length,
          ByteBufferCodecFactory.this.direct);
      result.put(bytes);
      result.flip();
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.