Connection<?> connection = context.getConnection();
Channel channel = GrizzlyChannel.getOrAddChannel(connection, url, handler);
try {
if (message instanceof Buffer) { // 收到新的数据包
Buffer buffer = (Buffer) message; // 缓存
int readable = buffer.capacity(); // 本次可读取新数据的大小
if (readable == 0) {
return context.getStopAction();
}
byte[] bytes; // byte[]缓存区,将Buffer转成byte[],再转成UnsafeByteArrayInputStream
int offset; // 指向已用数据的偏移量,off之前的数据都是已用过的