code: public static int skipToNextMatchingShort(byte[] buffer, int offset, int value)
     {
        int nextOffset = offset;
        while (getShort(buffer, nextOffset) != value)
        {
           ++nextOffset;
        }
        nextOffset += 2;
  
        return nextOffset;
     }
docs: Skip to the next matching short value.
  
  @param buffer input data array
  @param offset start offset into the input array
  @param value value to match
  @return offset of matching pattern