@Override public void convertBytes(final LongArray data, final byte[] bytes, final int planesRead) { final ImageMetadata iMeta = reader().getMetadata().get(0); if (isCompatible()) { final int bpp = getBitsPerElement() / 8; final int offset = planesRead * (bytes.length / bpp); final ByteBuffer bb = ByteBuffer.wrap(bytes); bb.order(iMeta.isLittleEndian() ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); bb.asLongBuffer().get(data.getCurrentStorageArray(), offset, bytes.length / bpp); } else { final int pixelType = iMeta.getPixelType(); final int bpp = FormatTools.getBytesPerPixel(pixelType); final int offset = planesRead * (bytes.length / bpp); for (int index = 0; index < bytes.length / bpp; index++) { final long value = (long) utils().decodeWord(bytes, index * bpp, pixelType, iMeta.isLittleEndian()); data.setValue(offset + index, value); } } }
@Override public void convertBytes(final LongArray data, final byte[] bytes, final int planesRead) { final ImageMetadata iMeta = reader().getMetadata().get(0); if (isCompatible()) { final int bpp = getBitsPerElement() / 8; final int offset = planesRead * (bytes.length / bpp); final ByteBuffer bb = ByteBuffer.wrap(bytes); bb.order(iMeta.isLittleEndian() ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); bb.asLongBuffer().get(data.getCurrentStorageArray(), offset, bytes.length / bpp); } else { final int pixelType = iMeta.getPixelType(); final int bpp = FormatTools.getBytesPerPixel(pixelType); final int offset = planesRead * (bytes.length / bpp); for (int index = 0; index < bytes.length / bpp; index++) { final long value = (long) utils().decodeWord(bytes, index * bpp, pixelType, iMeta.isLittleEndian()); data.setValue(offset + index, value); } } }