final char[] source = ((CharArray) store).getCurrentStorageArray(); final char[] chars = new char[planeSize]; System.arraycopy(source, planeSize *
@Override public void convertBytes(final CharArray data, final byte[] bytes, final int planesRead) { final ImageMetadata iMeta = reader().getMetadata().get(0); if (isCompatible()) { final int offset = planesRead * bytes.length; final ByteBuffer bb = ByteBuffer.wrap(bytes); bb.order(iMeta.isLittleEndian() ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); bb.asCharBuffer() .get(data.getCurrentStorageArray(), offset, bytes.length); } 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 char value = (char) utils().decodeWord(bytes, index * bpp, pixelType, iMeta.isLittleEndian()); data.setValue(offset + index, value); } } }
final char[] source = ((CharArray) store).getCurrentStorageArray(); final char[] chars = new char[planeSize]; System.arraycopy(source, planeSize *
@Override public void convertBytes(final CharArray data, final byte[] bytes, final int planesRead) { final ImageMetadata iMeta = reader().getMetadata().get(0); if (isCompatible()) { final int offset = planesRead * bytes.length; final ByteBuffer bb = ByteBuffer.wrap(bytes); bb.order(iMeta.isLittleEndian() ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); bb.asCharBuffer() .get(data.getCurrentStorageArray(), offset, bytes.length); } 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 char value = (char) utils().decodeWord(bytes, index * bpp, pixelType, iMeta.isLittleEndian()); data.setValue(offset + index, value); } } }
return dirty ? ( volatil ? ( RandomAccessibleCacheLoader< T, A, CA > ) new RandomAccessibleCacheLoader<>( grid, source, type, new CharArray( 0 ), a -> new DirtyVolatileCharArray( a.getCurrentStorageArray(), true ) ) : ( RandomAccessibleCacheLoader< T, A, CA > ) new RandomAccessibleCacheLoader<>( grid, source, type, new CharArray( 0 ), a -> new DirtyCharArray( a.getCurrentStorageArray() ) ) ) : ( volatil ? ( RandomAccessibleCacheLoader< T, A, CA > ) new RandomAccessibleCacheLoader<>( grid, source, type, new CharArray( 0 ), a -> new VolatileCharArray( a.getCurrentStorageArray(), true ) ) : ( RandomAccessibleCacheLoader< T, A, CA > ) new RandomAccessibleCacheLoader<>( grid, source, type, new CharArray( 0 ), a -> a ) ); case DOUBLE: