Java: How to convert int[] to byte[]
来源:互联网 发布:淘宝号登录 编辑:程序博客网 时间:2024/05/16 18:25
import java.nio.*; import java.net.*; class Test { public static void main(String [] args) throws Exception // Just for simplicity! { int[] data = { 100, 200, 300, 400 }; ByteBuffer byteBuffer = ByteBuffer.allocate(data.length * 4); IntBuffer intBuffer = byteBuffer.asIntBuffer(); intBuffer.put(data); byte[] array = byteBuffer.array(); for (int i=0; i < array.length; i++) { System.out.println(i + ": " + array[i]); } } }
- Java: How to convert int[] to byte[]
- How to convert Java String into byte[]?
- How to convert List<Integer> to int[] in Java?
- Convert int? to int
- Java : how to convert text to image
- How to convert from int to string in objective c
- How to convert from int to string in objective c
- Convert short to byte[] in Java
- Java – Convert String to int
- str convert to int
- How can I convert String to Int in C#?
- convert from to (byte [] array)
- convert byte[4] to int32
- How to convert negative number to positive in Java?
- How to convert Java object to / from JSON (Gson)
- How to convert char array to String in Java
- How to convert ArrayList to Set in Java with Example
- How to convert Java object to / from JSON (Gson)
- 使用easyUI 创建复杂的toolbar到datagrid
- 网站Cache全分析
- Windows平台下fwrite函数0x0A变成0x0D 0x0A
- HDU-1431-素数回文
- windows下cmd脚本去掉打印输出方法
- Java: How to convert int[] to byte[]
- C++的临时对象
- InputStream与DataInputStream区别
- 表格的操作包括:标记行、移动行、删除行、插入行
- c#的udp通讯代码
- 21天学通JAVA——学习笔记
- jdk时区相差8小时 .
- 虚拟机下系统键盘无法使用
- 《PicSi的实现细节》 第2节 窗口类CAboutDlg的定义