705706707708709710711712713714715
if (ret > 0) { readBytes = ret; } } } finally { buf.flip(); } if (readBytes > 0) { IoFilterChain filterChain = session.getFilterChain(); filterChain.fireMessageReceived(buf);
237238239240241242243244245246247
if (readBytes > 0) { IoBuffer buf = IoBuffer .wrap(data, 0, readBytes); buf.put(data, 0, readBytes); buf.flip(); getFilterChain().fireMessageReceived( buf); } } catch (IOException e) { getFilterChain().fireExceptionCaught(
460461462463464465466467468469470
if (remoteAddress != null) { IoSession session = newSessionWithoutLock( remoteAddress, localAddress(handle)); readBuf.flip(); IoBuffer newBuf = IoBuffer.allocate(readBuf.limit()); newBuf.put(readBuf); newBuf.flip();
464465466467468469470471472473474
readBuf.flip(); IoBuffer newBuf = IoBuffer.allocate(readBuf.limit()); newBuf.put(readBuf); newBuf.flip(); session.getFilterChain().fireMessageReceived(newBuf); } }
6768697071727374757677
buf.put(body); buf.put((byte)config.getEndByte1()); buf.put((byte)config.getEndByte2()); // flip the buffer so we can use it to write to the out stream buf.flip(); LOG.debug("Encoded HL7 from {} to byte stream", message.getClass().getCanonicalName()); out.write(buf); } }
434445464748495051
ByteBuffer encodedByteBuf = ChangePasswordEncoder.encode( ( AbstractPasswordMessage ) message, isTcp ); IoBuffer buf = IoBuffer.allocate( encodedByteBuf.remaining() ); buf.put( encodedByteBuf.array() ); buf.flip(); out.write( buf ); } }
8586878889909192939495
@Override public void messageReceived(IoSession session, Object message) throws Exception { IoBuffer recv = (IoBuffer) message; IoBuffer sent = IoBuffer.allocate(recv.remaining()); sent.put(recv); sent.flip(); session.write(sent); } }); acceptor.setReuseAddress(true); acceptor.bind(new InetSocketAddress(echoPort));
424344454647484950
boolean isTcp = !session.getTransportMetadata().isConnectionless(); ByteBuffer encodedByteBuf = KerberosEncoder.encode( asn1Obj, isTcp ); IoBuffer buf = IoBuffer.allocate( encodedByteBuf.remaining() ); buf.put( encodedByteBuf.array() ); buf.flip(); out.write( buf ); } }
8485868788899091929394
118119120121122123124125126127128
tmp.putString(delimiter.getValue(), charset.newEncoder()); } catch (CharacterCodingException cce) { } tmp.flip(); delimBuf = tmp; } } /**