public void mark() { ios.mark(); }
public WritableImageByteChannel(ImageOutputStream stream) { this.stream = stream; this.stream.mark(); }
public void mark() { ios.mark(); }
public boolean canInsertImage(int imageIndex) throws IOException { if (getOutput() == null) { throw new IllegalStateException("getOutput() == null!"); } // Mark position as locateIFD() will seek to IFD at imageIndex. stream.mark(); // locateIFD() will throw an IndexOutOfBoundsException if // imageIndex is < -1 or is too big thereby satisfying the spec. long[] ifdpos = new long[1]; long[] ifd = new long[1]; locateIFD(imageIndex, ifdpos, ifd); // Reset to position before locateIFD(). stream.reset(); return true; }
public boolean canInsertImage(int imageIndex) throws IOException { if (getOutput() == null) { throw new IllegalStateException("getOutput() == null!"); } // Mark position as locateIFD() will seek to IFD at imageIndex. stream.mark(); // locateIFD() will throw an IndexOutOfBoundsException if // imageIndex is < -1 or is too big thereby satisfying the spec. long[] ifdpos = new long[1]; long[] ifd = new long[1]; locateIFD(imageIndex, ifdpos, ifd); // Reset to position before locateIFD(). stream.reset(); return true; }
public boolean canInsertImage(int imageIndex) throws IOException { if (getOutput() == null) { throw new IllegalStateException("getOutput() == null!"); } // Mark position as locateIFD() will seek to IFD at imageIndex. stream.mark(); // locateIFD() will throw an IndexOutOfBoundsException if // imageIndex is < -1 or is too big thereby satisfying the spec. long[] ifdpos = new long[1]; long[] ifd = new long[1]; locateIFD(imageIndex, ifdpos, ifd); // Reset to position before locateIFD(). stream.reset(); return true; }
public boolean canInsertImage(int imageIndex) throws IOException { if (getOutput() == null) { throw new IllegalStateException("getOutput() == null!"); } // Mark position as locateIFD() will seek to IFD at imageIndex. stream.mark(); // locateIFD() will throw an IndexOutOfBoundsException if // imageIndex is < -1 or is too big thereby satisfying the spec. long[] ifdpos = new long[1]; long[] ifd = new long[1]; locateIFD(imageIndex, ifdpos, ifd); // Reset to position before locateIFD(). stream.reset(); return true; }
private TIFFIFD readIFD(int imageIndex) throws IOException { if (stream == null) { throw new IllegalStateException("Output not set!"); } if (imageIndex < 0) { throw new IndexOutOfBoundsException("imageIndex < 0!"); } stream.mark(); long[] ifdpos = new long[1]; long[] ifd = new long[1]; locateIFD(imageIndex, ifdpos, ifd); if (ifd[0] == 0) { stream.reset(); throw new IndexOutOfBoundsException ("imageIndex out of bounds!"); } List tagSets = new ArrayList(1); tagSets.add(BaselineTIFFTagSet.getInstance()); TIFFIFD rootIFD = new TIFFIFD(tagSets); // XXX Ignore unknown fields in metadata presumably because // any fields needed to write pixels would be known? rootIFD.initialize(stream, true); stream.reset(); return rootIFD; }
private TIFFIFD readIFD(int imageIndex) throws IOException { if (stream == null) { throw new IllegalStateException("Output not set!"); } if (imageIndex < 0) { throw new IndexOutOfBoundsException("imageIndex < 0!"); } stream.mark(); long[] ifdpos = new long[1]; long[] ifd = new long[1]; locateIFD(imageIndex, ifdpos, ifd); if (ifd[0] == 0) { stream.reset(); throw new IndexOutOfBoundsException ("imageIndex out of bounds!"); } List tagSets = new ArrayList(1); tagSets.add(BaselineTIFFTagSet.getInstance()); TIFFIFD rootIFD = new TIFFIFD(tagSets); // XXX Ignore unknown fields in metadata presumably because // any fields needed to write pixels would be known? rootIFD.initialize(stream, true); stream.reset(); return rootIFD; }
private TIFFIFD readIFD(int imageIndex) throws IOException { if (stream == null) { throw new IllegalStateException("Output not set!"); } if (imageIndex < 0) { throw new IndexOutOfBoundsException("imageIndex < 0!"); } stream.mark(); long[] ifdpos = new long[1]; long[] ifd = new long[1]; locateIFD(imageIndex, ifdpos, ifd); if (ifd[0] == 0) { stream.reset(); throw new IndexOutOfBoundsException ("imageIndex out of bounds!"); } List tagSets = new ArrayList(1); tagSets.add(BaselineTIFFTagSet.getInstance()); TIFFIFD rootIFD = new TIFFIFD(tagSets); // XXX Ignore unknown fields in metadata presumably because // any fields needed to write pixels would be known? rootIFD.initialize(stream, true); stream.reset(); return rootIFD; }
private TIFFIFD readIFD(int imageIndex) throws IOException { if (stream == null) { throw new IllegalStateException("Output not set!"); } if (imageIndex < 0) { throw new IndexOutOfBoundsException("imageIndex < 0!"); } stream.mark(); long[] ifdpos = new long[1]; long[] ifd = new long[1]; locateIFD(imageIndex, ifdpos, ifd); if (ifd[0] == 0) { stream.reset(); throw new IndexOutOfBoundsException ("imageIndex out of bounds!"); } List tagSets = new ArrayList(1); tagSets.add(BaselineTIFFTagSet.getInstance()); TIFFIFD rootIFD = new TIFFIFD(tagSets); // XXX Ignore unknown fields in metadata presumably because // any fields needed to write pixels would be known? rootIFD.initialize(stream, true); stream.reset(); return rootIFD; }
/** * Tests {@link ChannelImageOutputStream#mark()} and {@code reset()} methods. * * @throws IOException should never happen since we read and write in memory only. */ @Test public void testMarkAndReset() throws IOException { initialize("testMarkAndReset", STREAM_LENGTH, 1000); // We need a larger buffer for this test. final ImageOutputStream referenceStream = (ImageOutputStream) this.referenceStream; /* * Fill both streams with random data. * During this process, randomly takes mark. */ int nbMarks = 0; for (int i=0; i<STREAM_LENGTH; i++) { if (randomEvent() && i < STREAM_LENGTH - Long.BYTES) { referenceStream.mark(); testedStream.mark(); nbMarks++; } final int v = random.nextInt(256); referenceStream.writeByte(v); testedStream.writeByte(v); } compareMarks(nbMarks); }
stream.mark(); // Mark beginning of next field stream.skipBytes(-4);
stream.mark(); // Mark beginning of next field stream.skipBytes(-4);
stream.mark(); // Mark beginning of next field stream.skipBytes(-4);
case 40: case 45: { referenceStream.mark(); testedStream.mark(); break;
stream.mark(); stream.seek(stripOrTileOffsetsPosition); stream.writeInt((int)pos);
stream.mark(); stream.seek(stripOrTileOffsetsPosition); stream.writeInt((int)pos);