Example usage for java.lang Long parseLong

List of usage examples for java.lang Long parseLong

Introduction

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

Prototype

public static long parseLong(String s, int radix) throws NumberFormatException 

Source Link

Document

Parses the string argument as a signed long in the radix specified by the second argument.

Usage

From source file:my.extensions.app.DateTimeFormatter.java

private String format(String message) {
    String msg = "";

    try {//from ww w. ja  va2s . co  m
        long ms = Long.parseLong(message, 10);
        msg = DateFormatUtils.format(ms, "yyyy-MM-dd HH:mm:ss");
    } catch (Exception e) {
        msg = e.getMessage();
    }

    return msg;
}

From source file:com.jaeksoft.searchlib.util.Sequence.java

public Sequence(File file, int radix) throws NumberFormatException, IOException {
    this.radix = radix;
    this.file = file;
    if (file.exists())
        if (file.length() > 0)
            counter = Long.parseLong(FileUtils.readFileToString(file), radix);
}