public void writeIccProfile(byte[] data) throws IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); stream.write((byte) 'I'); stream.write((byte) 'C'); stream.write((byte) 'C'); stream.write(0); stream.write(0); DeflaterOutputStream zip = new DeflaterOutputStream(stream); zip.write(data); zip.close(); writeChunk(iCCP, stream.toByteArray()); }
public void writeIccProfile(byte[] data) throws IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); stream.write((byte) 'I'); stream.write((byte) 'C'); stream.write((byte) 'C'); stream.write(0); stream.write(0); DeflaterOutputStream zip = new DeflaterOutputStream(stream); zip.write(data); zip.close(); writeChunk(iCCP, stream.toByteArray()); }
public void writeData(byte[] data, int stride) throws IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); DeflaterOutputStream zip = new DeflaterOutputStream(stream); int k; for (k = 0; k < data.length - stride; k += stride) { zip.write(0); zip.write(data, k, stride); } int remaining = data.length - k; if (remaining > 0) { zip.write(0); zip.write(data, k, remaining); } zip.close(); writeChunk(IDAT, stream.toByteArray()); }
public void writeData(byte[] data, int stride) throws IOException { ByteArrayOutputStream stream = new ByteArrayOutputStream(); DeflaterOutputStream zip = new DeflaterOutputStream(stream); int k; for (k = 0; k < data.length - stride; k += stride) { zip.write(0); zip.write(data, k, stride); } int remaining = data.length - k; if (remaining > 0) { zip.write(0); zip.write(data, k, remaining); } zip.close(); writeChunk(IDAT, stream.toByteArray()); }
photometric == TIFFConstants.PHOTOMETRIC_MINISBLACK ? RawImageData.CCITT_BLACKIS1 : 0, g4.close(), null); } else { zip.close(); RawImageHelper.updateRawImageParameters(tiff.image, w, h, samplePerPixel - extraSamples, bitsPerSample, stream.toByteArray()); tiff.image.setDeflated(true); tiff.image.setRotation(rotation); if (extraSamples > 0) { mzip.close(); RawImageData mimg = (RawImageData) ImageDataFactory.createRawImage(null); RawImageHelper.updateRawImageParameters(mimg, w, h, 1, bitsPerSample, mstream.toByteArray());
photometric == TIFFConstants.PHOTOMETRIC_MINISBLACK ? RawImageData.CCITT_BLACKIS1 : 0, g4.close(), null); } else { zip.close(); RawImageHelper.updateRawImageParameters(tiff.image, w, h, samplePerPixel - extraSamples, bitsPerSample, stream.toByteArray()); tiff.image.setDeflated(true); tiff.image.setRotation(rotation); if (extraSamples > 0) { mzip.close(); RawImageData mimg = (RawImageData) ImageDataFactory.createRawImage(null); RawImageHelper.updateRawImageParameters(mimg, w, h, 1, bitsPerSample, mstream.toByteArray());