private void readDirectories(ByteSource byteSource, FormatCompliance formatCompliance, Listener listener) throws ImageReadException, IOException { TiffHeader tiffHeader = readTiffHeader(byteSource, formatCompliance); if (!listener.setTiffHeader(tiffHeader)) return; int offset = tiffHeader.offsetToFirstIFD; int dirType = TiffDirectory.DIRECTORY_TYPE_ROOT; List visited = new ArrayList(); readDirectory(byteSource, offset, dirType, formatCompliance, listener, visited); }
private void readDirectories(ByteSource byteSource, FormatCompliance formatCompliance, Listener listener) throws ImageReadException, IOException { TiffHeader tiffHeader = readTiffHeader(byteSource, formatCompliance); if (!listener.setTiffHeader(tiffHeader)) return; int offset = tiffHeader.offsetToFirstIFD; int dirType = TiffDirectory.DIRECTORY_TYPE_ROOT; List visited = new ArrayList(); readDirectory(byteSource, offset, dirType, formatCompliance, listener, visited); }
private TiffHeader readTiffHeader(ByteSource byteSource, FormatCompliance formatCompliance) throws ImageReadException, IOException { InputStream is = null; try { is = byteSource.getInputStream(); return readTiffHeader(is, formatCompliance); } finally { try { if (is != null) is.close(); } catch (Exception e) { Debug.debug(e); } } }
private TiffHeader readTiffHeader(ByteSource byteSource, FormatCompliance formatCompliance) throws ImageReadException, IOException { InputStream is = null; try { is = byteSource.getInputStream(); return readTiffHeader(is, formatCompliance); } finally { try { if (is != null) is.close(); } catch (Exception e) { Debug.debug(e); } } }