docs: public void processTiff(@NotNull final RandomAccessReader reader,
                              @NotNull final TiffHandler handler,
                              final int tiffHeaderOffset) throws TiffProcessingException, IOException
      {
          // This must be either "MM" or "II".
          short byteOrderIdentifier = reader.getInt16(tiffHeaderOffset);
  
          if (byteOrderIdentifier == 0x4d4d) { // "MM"
              reader.setMotorolaByteOrder(true);
          } else if (byteOrderIdentifier == 0x4949) { // "II"
              reader.setMotorolaByteOrder(false);
          } else {
              throw new TiffProcessingException("Unclear distinction between Motorola/Intel byte ordering: " + byteOrderIdentifier);
          }
  
          // Check the next two values for correctness.
          final int tiffMarker = reader.getUInt16(2 + tiffHeaderOffset);
          handler.setTiffMarker(tiffMarker);
  
          int firstIfdOffset = reader.getInt32(4 + tiffHeaderOffset) + tiffHeaderOffset;
  
          // David Ekholm sent a digital camera image that has this problem
          // TODO getLength should be avoided as it causes RandomAccessStreamReader to read to the end of the stream
          if (firstIfdOffset >= reader.getLength() - 1) {
              handler.warn("First IFD offset is beyond the end of the TIFF data segment -- trying default offset");
              // First directory normally starts immediately after the offset bytes, so try that
              firstIfdOffset = tiffHeaderOffset + 2 + 2 + 4;
          }
  
          Set<Integer> processedIfdOffsets = new HashSet<Integer>();
          processIfd(handler, reader, processedIfdOffsets, firstIfdOffset, tiffHeaderOffset);
      }