@Override public void writeToSequence(final IIOImage image, final ImageWriteParam param) throws IOException { if (!writingSequence) { throw new IllegalStateException("prepareWriteSequence() must be called before writeToSequence()!"); } if (sequenceIndex > 0) { imageOutput.flushBefore(sequenceLastIFDPos); imageOutput.seek(imageOutput.length()); } sequenceLastIFDPos = writePage(sequenceIndex++, image, param, sequenceTIFFWriter, sequenceLastIFDPos); }
private void writePICTTrailer() throws IOException { // Write out end opcode. Be sure to be word-aligned. long length = imageOutput.length(); if (length == -1) { throw new IIOException("Cannot write trailer without knowing length"); } if ((length & 1) > 0) { imageOutput.writeByte(0); } imageOutput.writeShort(PICT.OP_END_OF_PICTURE); }
public void flushAll() throws IOException { long length = stream.length(); if (length != -1) { stream.seek(length); stream.flush(); } else { stream.flush(); } }
private void writePICTTrailer() throws IOException { // Write out end opcode. Be sure to be word-aligned. long length = mImageOutput.length(); if (length == -1) { throw new IIOException("Cannot write trailer without knowing length"); } if ((length & 1) > 0) { mImageOutput.writeByte(0); } mImageOutput.writeShort(PICT.OP_END_OF_PICTURE); }
private long available() throws IOException { checkClosed(); long pos = out.getStreamPosition(); if (pos < offset) { out.seek(offset); pos = offset; } return offset + out.length() - pos; }
private void writePICTTrailer() throws IOException { // Write out end opcode. Be sure to be word-aligned. long length = imageOutput.length(); if (length == -1) { throw new IIOException("Cannot write trailer without knowing length"); } if ((length & 1) > 0) { imageOutput.writeByte(0); } imageOutput.writeShort(PICT.OP_END_OF_PICTURE); }
private long available() throws IOException { checkClosed(); long pos = out.getStreamPosition(); if (pos < offset) { out.seek(offset); pos = offset; } return offset + out.length() - pos; }
byte[] b = new byte[(int) ios.length()]; ios.read(b); ios.close();
b[2] == (byte)0x00 && b[3] == (byte)0x2a)) { this.nextSpace = stream.length(); } else {
b[2] == (byte)0x00 && b[3] == (byte)0x2a)) { this.nextSpace = stream.length(); } else {
b[2] == (byte)0x00 && b[3] == (byte)0x2a)) { this.nextSpace = stream.length(); } else {
b[2] == (byte)0x00 && b[3] == (byte)0x2a)) { this.nextSpace = stream.length(); } else {
public void testWrite() throws IOException { final int[] expected = new int[]{3, 6, 128973, 8}; _tiffValue.setData(ProductData.createInstance(expected)); _tiffValue.write(_stream); assertEquals(16, _stream.length()); _stream.seek(0); for (int i = 0; i < expected.length; i++) { assertEquals("failure at index " + i, expected[i], _stream.readInt()); } }