private static int moveToTiffEntryWithTag(InputStream is,int length,boolean isLittleEndian,int tagToFind) throws IOException {
  if (length < 14) {
    return 0;
  }
  int numEntries=StreamProcessor.readPackedInt(is,2,isLittleEndian);
  length-=2;
  while (numEntries-- > 0 && length >= 12) {
    int tag=StreamProcessor.readPackedInt(is,2,isLittleEndian);
    length-=2;
    if (tag == tagToFind) {
      return length;
    }
    is.skip(10);
    length-=10;
  }
  return 0;
}

private static int moveToTiffEntryWithTag ( InputStream is , int length , boolean isLittleEndian , int tagToFind ) throws IOException { if ( length < 14 ) { return 0 ; } int numEntries = StreamProcessor . readPackedInt ( is , 2 , isLittleEndian ) ; length -= 2 ; while ( numEntries -- > 0 && length >= 12 ) { int tag = StreamProcessor . readPackedInt ( is , 2 , isLittleEndian ) ; length -= 2 ; if ( tag == tagToFind ) { return length ; } is . skip ( 10 ) ; length -= 10 ; } return 0 ; }
positions the given input stream to the entry that has a specified tag . tag will be consumed .
