public static ArrayIO getArrayIO(Runtime runtime) { if (runtime.byteOrder().equals(ByteOrder.BIG_ENDIAN)) { return runtime.addressSize() == 8 ? BE64ArrayIO.INSTANCE : BE32ArrayIO.INSTANCE; } else { return runtime.addressSize() == 8 ? LE64ArrayIO.INSTANCE : LE32ArrayIO.INSTANCE; } }
public static ArrayIO getArrayIO(Runtime runtime) { if (runtime.byteOrder().equals(ByteOrder.BIG_ENDIAN)) { return runtime.addressSize() == 8 ? BE64ArrayIO.INSTANCE : BE32ArrayIO.INSTANCE; } else { return runtime.addressSize() == 8 ? LE64ArrayIO.INSTANCE : LE32ArrayIO.INSTANCE; } }
public static ArrayIO getArrayIO(Runtime runtime) { if (runtime.byteOrder().equals(ByteOrder.BIG_ENDIAN)) { return runtime.addressSize() == 8 ? BE64ArrayIO.INSTANCE : BE32ArrayIO.INSTANCE; } else { return runtime.addressSize() == 8 ? LE64ArrayIO.INSTANCE : LE32ArrayIO.INSTANCE; } }
.order(runtime.byteOrder()); int rv = lib.tjDecompress2( codec, ByteBuffer.wrap(jpegData), jpegData.length, outBuf,
.order(runtime.byteOrder()); int rv = lib.tjCompress2( codec, inBuf, img.getWidth(), 0, img.getHeight(), pixelFmt, throw new TurboJpegException(lib.tjGetErrorStr()); ByteBuffer outBuf = ByteBuffer.allocate(lenPtr.getValue().intValue()).order(runtime.byteOrder()); bufPtr.get(0, outBuf.array(), 0, lenPtr.getValue().intValue()); ((Buffer) outBuf).rewind();
bufPtr = lib.tjAlloc(bufSize); NativeLongByReference lenRef = new NativeLongByReference(bufSize); Buffer inBuf = ByteBuffer.wrap(jpegData).order(runtime.byteOrder()); int rv = lib.tjTransform( codec, inBuf, jpegData.length, 1, new PointerByReference(bufPtr), throw new TurboJpegException(lib.tjGetErrorStr()); ByteBuffer outBuf = ByteBuffer.allocate(lenRef.getValue().intValue()).order(runtime.byteOrder()); bufPtr.get(0, outBuf.array(), 0, lenRef.getValue().intValue()); ((Buffer) outBuf).rewind();