사용자 도구

사이트 도구


java:number

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
마지막 판 양쪽 다음 판
java:number [2015/09/24 16:55]
kwon37xi
java:number [2020/08/11 14:19]
kwon37xi [Hex 16진수]
줄 56: 줄 56:
 String hex = String.format("%016x", value); String hex = String.format("%016x", value);
 </code> </code>
 +  * [[https://stackoverflow.com/questions/9655181/how-to-convert-a-byte-array-to-a-hex-string-in-java|bytearray - How to convert a byte array to a hex string in Java? - Stack Overflow]] ''byte[]''를 hex 문자열로 변환하는 다양한 방법들
 +    * Apache Commons Codec
 +<code java>
 +import org.apache.commons.codec.binary.Hex;
 +...
 +Hex.encodeHexString(someByteArray));
 +</code>
 +  * 순수 Java
  
 +<code java>
 +byte bytes[] = {(byte)0, (byte)0, (byte)134, (byte)0, (byte)61};
 +String hex = javax.xml.bind.DatatypeConverter.printHexBinary(bytes);
 +</code>
java/number.txt · 마지막으로 수정됨: 2021/02/17 00:09 저자 kwon37xi