()
| 329 | } |
| 330 | |
| 331 | private byte[][] groupInternalBytes() { |
| 332 | byte[] raw = internal(); |
| 333 | int unitSize = dtype.numOfBytes; |
| 334 | if (raw.length <= 0 || raw.length % unitSize != 0) { |
| 335 | throw new IllegalArgumentException(String.format( |
| 336 | "%s size %d cannot divide byte array size %d", dtype.toString(), unitSize, raw.length)); |
| 337 | } |
| 338 | |
| 339 | int numOfUnits = raw.length / unitSize; |
| 340 | byte[][] units = new byte[numOfUnits][unitSize]; |
| 341 | for (int i = 0; i < numOfUnits; ++i) { |
| 342 | System.arraycopy(raw, i * unitSize, units[i], 0, unitSize); |
| 343 | } |
| 344 | return units; |
| 345 | } |
| 346 | |
| 347 | /** |
| 348 | * Get the device of current array. |
no test coverage detected