Java Long Number Create toLong(String s)

Here you can find the source of toLong(String s)

Description

to Long

License

Open Source License

Declaration

static long toLong(String s) 

Method Source Code

//package com.java2s;

public class Main {
    static long toLong(String s) {
        byte[] bytes = s.getBytes();
        long value = byteToInt(bytes, 0) & 0xFFFFFFFFL;
        return value;
    }/*from w  w  w .ja  v a 2s .com*/

    public static final int byteToInt(byte[] source, int sourceOffset) {
        return ((source[sourceOffset++] & 0xFF) << 24) | ((source[sourceOffset++] & 0xFF) << 16)
                | ((source[sourceOffset++] & 0xFF) << 8) | (source[sourceOffset++] & 0xFF);
    }
}

Related

  1. toLong(String numeric)
  2. toLong(String param)
  3. toLong(String parameter)
  4. toLong(String s)
  5. toLong(String s)
  6. toLong(String s)
  7. toLong(String s)
  8. toLong(String s)
  9. ToLong(String s)