Advertisement

Netty中的ByteBuf进行读取和编写字符串操作

阅读量:

1、项目对象模型

复制代码
      <dependency>

    
         <groupId>io.netty</groupId>
    
         <artifactId>netty-all</artifactId>
    
         <version>4.1.75.Final</version>
    
     </dependency>
    
    
    
    
复制代码
 package com.example.demo.util;

    
  
    
  
    
 import io.netty.buffer.ByteBuf;
    
 import io.netty.buffer.Unpooled;
    
  
    
 import java.util.Random;
    
  
    
  
    
 public class NettyLearn {
    
  
    
     public static void main(String[] args) {
    
 //普通的buff  固定大小的堆buff
    
     ByteBuf heapBuffer = Unpooled.buffer(128);
    
     System.out.pr

全部评论 (0)

还没有任何评论哟~