//把一个long型的数据转换为数组 Long num = 9809L; ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(bos); dos.writeLong(num); byte[] buf = bos.toByteArray(); System.out.println(buf.length);
时间: 2024-10-30 08:39:56