Example usage for java.lang Long valueOf

List of usage examples for java.lang Long valueOf

Introduction

In this page you can find the example usage for java.lang Long valueOf.

Prototype

@HotSpotIntrinsicCandidate
public static Long valueOf(long l) 

Source Link

Document

Returns a Long instance representing the specified long value.

Usage

From source file:Main.java

public static void putDouble(byte[] bb, double x, int index) {
    // byte[] b = new byte[8];
    long l = Double.doubleToLongBits(x);
    for (int i = 0; i < 4; i++) {
        bb[index + i] = Long.valueOf(l).byteValue();
        l = l >> 8;//from ww w.java  2  s. co m
    }
}

From source file:Main.java

public static String getRealData(String data) {
    SimpleDateFormat sdf5 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Date d = new Date(Long.valueOf(data));
    return sdf5.format(d);
}

From source file:Main.java

public static String getSimpleDateString(String timeStamp) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd ");
    long timeSta = Long.valueOf(timeStamp);
    return dateFormat.format(new Date(timeSta * 1000L));
}

From source file:Main.java

public static void putDouble(byte[] bb, double x, int index) {
    long l = Double.doubleToLongBits(x);
    for (int i = 0; i < 4; i++) {
        bb[(index + i)] = Long.valueOf(l).byteValue();
        l >>= 8;//from w  ww. ja  va  2  s .  c o  m
    }
}

From source file:Main.java

public static String TimeStampString(String style, String times) {

    SimpleDateFormat format = new SimpleDateFormat(style);
    long lcc_time = Long.valueOf(times);
    return format.format(new Date(lcc_time * 1000L));
}

From source file:Main.java

public static Long[] strToLongArray(String str, String separator) {
    String[] sArr = str.split(",");
    Long[] lArr = new Long[sArr.length];
    for (int i = 0; i < sArr.length; i++) {
        lArr[i] = Long.valueOf(sArr[i]);
    }/*from   w ww  . j a  v a 2  s  .com*/
    return lArr;
}

From source file:Main.java

public static String UnixToDate(String time) {

    SimpleDateFormat sdr = new SimpleDateFormat("yyyy-MM-dd");
    @SuppressWarnings("unused")
    long lcc = Long.valueOf(time);
    int i = Integer.parseInt(time);
    String times = sdr.format(new Date(i * 1000L));
    return times;

}

From source file:Main.java

public static Date formatEndDateForObject(String string) {
    Calendar calendar = Calendar.getInstance();
    calendar.setTimeInMillis(Long.valueOf(string));
    return calendar.getTime();
}

From source file:Main.java

public static Date formatStartDateForObject(String string) {
    Calendar calendar = Calendar.getInstance();
    calendar.setTimeInMillis(Long.valueOf(string));
    return calendar.getTime();
}

From source file:Main.java

public static String getFormatDayTime(String time) {
    if (TextUtils.isEmpty(time))
        return null;

    return getFormatDayTime(Long.valueOf(time));
}