JAVA - Converting from byte[] to hex representation -


इस सवाल का पहले से ही एक उत्तर है: < / p>

  • 17 उत्तरों

    क्या कोई भी रूपांतरित करने का कोई तरीका है बाइट [] से हेक्स प्रतिनिधित्व करने के लिए? मैंने हर जगह खोज की है लेकिन मुझे कुछ भी नहीं मिला! क्या कोई मेरी मदद कर सकता है?

    इसे आज़माएं:

      निजी स्थिर स्ट्रिंग अंक = "0123456789abcdef"; सार्वजनिक स्थैतिक स्ट्रिंग टूहेक्स (बाइट [] डेटा) {स्ट्रिंगबफर बफ़ = नया स्ट्रिंगबफर (); के लिए (इंट आई = 0; आई! डेटा = लैंप; आई ++) {इंट वी = डाटा [आई] & amp; 0xff; buf.append (अंक। चाट (v & gt; & gt; 4)); buf.append (अंक। चाट (v & amp; 0xf)); } वापसी buf.toString (); }    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -