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

Method stringToBytes

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

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

(String value)

Source from the content-addressed store, hash-verified

301 * avoid String.getBytes() because it is using system specific character encoding.
302 */
303 public static byte[] stringToBytes(String value) {
304 try {
305 return value.getBytes("ISO-8859-1");
306 } catch (UnsupportedEncodingException e) {
307 // can't happen: Latin 1 is a standard encoding
308 return null;
309 }
310 }
311
312 /**
313 * convert a byte[] with 8bit latin 1 to java string

Callers 5

CompleteCommandMethod · 0.95
getHighBitStringMethod · 0.95
writeStringMethod · 0.95
fwriteStringMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected