netty/demo1/src/main/java/cn/bunny/file_dir/Demo3.java

16 lines
330 B
Java
Raw Normal View History

package cn.bunny.file_dir;
2024-05-22 16:53:48 +08:00
import java.nio.ByteBuffer;
public class Demo3 {
public static void main(String[] args) {
ByteBuffer buffer = ByteBuffer.allocate(10);
buffer.put((byte) 0x61);
buffer.put(new byte[]{0x62, 0x63, 0x64});
// 共有4个值
2024-05-22 16:53:48 +08:00
System.out.println(buffer);
}
}