private void writeIFD(FileChannel channel, int start) throws IOException { channel.position(start); ByteBuffer buffer = ByteBuffer.allocate(2); int n = tags.size(); buffer.putShort((short) n); buffer.flip(); channel.write(buffer); start += 2; startOverflowData = start + 12 * tags.size() + 4; nextOverflowData = startOverflowData; for (IFDEntry elem : tags) { writeIFDEntry(channel, elem, start); start += 12; } // firstIFD = startOverflowData; // position to where the "next IFD" goes channel.position(startOverflowData - 4); lastIFD = startOverflowData - 4; if (debugRead) System.out.println("pos before writing nextIFD= " + channel.position()); buffer = ByteBuffer.allocate(4); buffer.putInt(0); buffer.flip(); channel.write(buffer); }
private void writeIFD(FileChannel channel, int start) throws IOException { channel.position(start); ByteBuffer buffer = ByteBuffer.allocate(2); int n = tags.size(); buffer.putShort((short) n); buffer.flip(); channel.write(buffer); start += 2; startOverflowData = start + 12 * tags.size() + 4; nextOverflowData = startOverflowData; for (IFDEntry elem : tags) { writeIFDEntry(channel, elem, start); start += 12; } // firstIFD = startOverflowData; // position to where the "next IFD" goes channel.position(startOverflowData - 4); lastIFD = startOverflowData - 4; if (debugRead) System.out.println("pos before writing nextIFD= " + channel.position()); buffer = ByteBuffer.allocate(4); buffer.putInt(0); buffer.flip(); channel.write(buffer); }
private void writeIFD(FileChannel channel, int start) throws IOException { channel.position(start); ByteBuffer buffer = ByteBuffer.allocate(2); int n = tags.size(); buffer.putShort((short) n); buffer.flip(); channel.write(buffer); start += 2; startOverflowData = start + 12 * tags.size() + 4; nextOverflowData = startOverflowData; for (IFDEntry elem : tags) { writeIFDEntry(channel, elem, start); start += 12; } // firstIFD = startOverflowData; // position to where the "next IFD" goes channel.position(startOverflowData - 4); lastIFD = startOverflowData - 4; if (debugRead) System.out.println("pos before writing nextIFD= " + channel.position()); buffer = ByteBuffer.allocate(4); buffer.putInt(0); buffer.flip(); channel.write(buffer); }