Protobuf uint 64 에서 자바 로 전환 하 는 long,데이터 가 너무 크 면 넘 칠 수 있 습 니 다.

474 단어 Protobuf자바
Protobuf uint 64 에서 자바 로 전환 하 는 long,데이터 가 너무 크 면 넘 칠 수 있 습 니 다.
 
      :

String id = "14001908927091871061";
Long long1 = Long.parseUnsignedLong(id);
System.out.println("id: " + id);

id = "-4444835146617680555";
Long longId = Long.parseLong(id);
System.out.println("longId: " + Long.toUnsignedString(longId));

// The code above prints the following lines:
id: 14001908927091871061
longId: 14001908927091871061

좋은 웹페이지 즐겨찾기