Returns the value of a particular index of a given tag as a
long.  The caller is responsible for ensuring that the tag is
present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED,
TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG.
182148
public long getFieldAsLong(int tag, int index) {
        Integer i = (Integer)fieldIndex.get(Integer.valueOf(tag));
        return fields[i.intValue()].getAsLong(index);
    }
1022553
public static long getLong(String key, long valueIfNullOrNotParseable) {
        String value = System.getProperty(key);
        if (Strings.isNullOrEmpty(value)) {
            return valueIfNullOrNotParseable;
        }
        try {
            return Long.parseLong(value);
        } catch (NumberFormatException e) {
            return valueIfNullOrNotParseable;
        }
    }
1275339
def ConsumeInteger(self, is_long=False):
    
    try:
      result = _ParseAbstractInteger(self.token, is_long=is_long)
    except ValueError as e:
      raise self.ParseError(str(e))
    self.NextToken()
    return result
620930
function getTagValues(littleEndian, dirEntries) {
        var TAG_VAL_OFFSET = 16,
            tagsToFind = qq.extend([], TAG_IDS),
            vals = {};

        qq.each(dirEntries, function(idx, entry) {
            var idHex = entry.slice(0, 4),
                id = littleEndian ? parseLittleEndian(idHex) : parseInt(idHex, 16),
                tagsToFindIdx = tagsToFind.indexOf(id),
                tagValHex, tagName, tagValLength;

            if (tagsToFindIdx >= 0) {
                tagName = TAG_INFO[id].name;
                tagValLength = TAG_INFO[id].bytes;
                tagValHex = entry.slice(TAG_VAL_OFFSET, TAG_VAL_OFFSET + (tagValLength * 2));
                vals[tagName] = littleEndian ? parseLittleEndian(tagValHex) : parseInt(tagValHex, 16);

                tagsToFind.splice(tagsToFindIdx, 1);
            }

            if (tagsToFind.length === 0) {
                return false;
            }
        });

        return vals;
    }
1307594
public static long getLongFromBytes(byte[] bytes,
                                        int    offset)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "getLongFromBytes: length = " + bytes.length + ", data = " + toHexString(bytes));
        long result = -1;
        if (bytes.length >= offset + 8)
        {
            result = ((bytes[0 + offset]&0xff) << 56) +
                     ((bytes[1 + offset]&0xff) << 48) +
                     ((bytes[2 + offset]&0xff) << 40) +
                     ((bytes[3 + offset]&0xff) << 32) +
                     ((bytes[4 + offset]&0xff) << 24) +
                     ((bytes[5 + offset]&0xff) << 16) +
                     ((bytes[6 + offset]&0xff) << 8) +
                      (bytes[7 + offset]&0xff);
        }
        if (tc.isEntryEnabled()) Tr.exit(tc, "getLongFromBytes " + result);

        return result;
    }
734913
public long getKeyAsLong(int index) throws IOException {
        if (index >= structure.keySizes.size()) {
            throw new IOException("Index " + index + " is out of range.");
        }
        return Bytes.toLong(key, structure.keyByteOffsets.get(index));
    }
1250560
public Long getLong(String name) {
        Object o = get(name);
        if (o instanceof Number) {
            return ((Number)o).longValue();
        }

        if (o != null) {
            try {
                return Long.parseLong(o.toString());
            }
            catch (NumberFormatException e) {}
        }
        return null;
    }
1013761
public long
getLong() throws IOException {
	String next = _getIdentifier("an integer");
	if (!Character.isDigit(next.charAt(0)))
		throw exception("expected an integer");
	try {
		return Long.parseLong(next);
	} catch (NumberFormatException e) {
		throw exception("expected an integer");
	}
}
811578
public static long readLong(byte b[], int offset) {
    long retValue;

    retValue = ((long)b[offset++]) << 56;
    retValue |= ((long)b[offset++] & 0xff) << 48;
    retValue |= ((long)b[offset++] & 0xff) << 40;
    retValue |= ((long)b[offset++] & 0xff) << 32;
    retValue |= ((long)b[offset++] & 0xff) << 24;
    retValue |= ((long)b[offset++] & 0xff) << 16;
    retValue |= ((long)b[offset++] & 0xff) << 8;
    retValue |= (long)b[offset] & 0xff;

    return retValue;
  }
1208949
public static int longToInt(long inLong) {

        if (inLong < Integer.MIN_VALUE) {
            return Integer.MIN_VALUE;
        }

        if (inLong > Integer.MAX_VALUE) {
            return Integer.MAX_VALUE;
        }

        return (int) inLong;
    }
1193535
public static final long getLong(InputStream is) throws IOException
   {
      byte[] data = new byte[8];
      is.read(data);
      return getLong(data, 0);
   }
536809
public long getLong( int index ) {
      Object o = get( index );
      if( o != null ){
         return o instanceof Number ? ((Number) o).longValue() : (long) getDouble( index );
      }
      throw new JSONException( "JSONArray[" + index + "] is not a number." );
   }
757147
public long toLong() {
    long value = 0;
    for (final byte b : shiftRight(this.bytes, this.bytes.length * 8
      - this.bitLength)) {
      final long shifted = value << 8;
      value = shifted;
      final int asInt = b & 0xFF;
      value += asInt;
    }
    return value;
  }
21831
private static final long gatherLongLE(final byte[] data, final int index) {
        int i1 = gatherIntLE(data, index);
        long l2 = gatherIntLE(data, index + 4);

        return uintToLong(i1) | (l2 << 32);
    }
431235
public float getFieldAsFloat(int tag, int index) {
        Integer i = (Integer)fieldIndex.get(Integer.valueOf(tag));
        return fields[i.intValue()].getAsFloat(index);
    }
356529
public void setLong(int index, long value)
    {
        checkPositionIndexes(index, index + SIZE_OF_LONG, this.length);
        index += offset;
        data[index] = (byte) (value);
        data[index + 1] = (byte) (value >>> 8);
        data[index + 2] = (byte) (value >>> 16);
        data[index + 3] = (byte) (value >>> 24);
        data[index + 4] = (byte) (value >>> 32);
        data[index + 5] = (byte) (value >>> 40);
        data[index + 6] = (byte) (value >>> 48);
        data[index + 7] = (byte) (value >>> 56);
    }
546988
function parseTag(buf) {
  var index = 0;
  var tag = buf[index++];
  var constructed = (tag & 0x20) == 0x20;
  
  if ((tag & 0x1F) == 0x1F) {
    do {
      tag = tag << 8;
      tag = tag | buf[index++];  
    } while((tag & 0x80) == 0x80);
    
    if (index > 4) {
      throw new RangeError("The length of the tag cannot be more than 4 bytes in this implementation");
    }
  }
  return { tag: tag, length: index, constructed: constructed };
}