字节操作ByteBufbuffer=Unpooled.buffer(10);ByteBufbyteBuf=Unpooled.copiedBuffer("hello,world!",Charset.forName("utf-8"));intlen=byteBuf.readableBytes();//可读字节数为12System.out.println("len="+len);//用for取出每个字节for(inti=0;i

字节操作ByteBufbuffer=Unpooled.buffer(10);ByteBufbyteBuf=Unpooled.copiedBuffer("hello,world!",Charset.forName("utf-8"));intlen=byteBuf.readableBytes();//可读字节数为12System.out.println("len="+len);//用for取出每个字节for(inti=0;i