MCPcopy Create free account
hub / github.com/demoth/jake2 / bytesToString

Method bytesToString

qcommon/src/main/java/jake2/qcommon/util/Lib.java:317–324  ·  view source on GitHub ↗

convert a byte[] with 8bit latin 1 to java string avoid new String(bytes) because it is using system specific character encoding.

(byte[] value)

Source from the content-addressed store, hash-verified

315 * avoid new String(bytes) because it is using system specific character encoding.
316 */
317 public static String bytesToString(byte[] value) {
318 try {
319 return new String(value, "ISO-8859-1");
320 } catch (UnsupportedEncodingException e) {
321 // can't happen: Latin 1 is a standard encoding
322 return null;
323 }
324 }
325
326 /** Helper method that savely handles the null termination of old C String data. */
327 public static String CtoJava(String old) {

Callers 1

getHighBitStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected