byte数组截取
//原始數組
byte[] bytes = ImageUtils.toByteArray(fromPaths[0]);
//新數組
byte[] b1 = new byte[bytes.length-80];
//從原始數組80位置開始截取后面所有
System.arraycopy(bytes, 80, b1, 0, bytes.length-80);
BufferData2D bufferData2D = new BufferData2D(ByteBuffer.wrap(b1), GridDataType.Int8);System.arraycopy(src, srcPos, dest, destPos, length)參數解析:src:byte源數組
srcPos:截取源byte數組起始位置(0位置有效)
dest,:byte目的數組(截取后存放的數組)
destPos:截取后存放的數組起始位置(0位置有效)
length:截取的數據長度
總結
- 上一篇: Android 画图板程序实例(Sket
- 下一篇: 一款成功的全球服游戏该如何进行架构选型与