222223224225226227228229230231232
// Fire the event. ByteArray array; if (readBytes == buf.capacity()) { array = new HeapByteArray(buf.array()); } else { array = new StaticPartialByteArray(buf.array(), 0, readBytes); } fireMessageReceived(channel, array); } if (ret < 0 || failure) {
7778798081828384858687
ByteArray array; if (readBytes == buf.length) { array = new HeapByteArray(buf); } else { array = new StaticPartialByteArray(buf, 0, readBytes); } fireMessageReceived(channel, array); } close(channel, channel.getSucceededFuture()); }