MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / toBytes

Method toBytes

vm/JavaAPI/src/java/net/URIHelper.java:566–572  ·  view source on GitHub ↗

Utility method to silently get UTF-8 bytes from a string, which should always work.

(String source)

Source from the content-addressed store, hash-verified

564 * always work.
565 */
566 static byte[] toBytes(String source) {
567 try {
568 return source.getBytes("UTF8");
569 } catch (UnsupportedEncodingException e) {
570 throw new IllegalArgumentException(e.getMessage());
571 }
572 }
573 /**
574 * Utility method to find the first invalid character as per RFC 2396
575 * section 2. This helps us prevent creating excessive objects in the

Callers 2

encodeStringMethod · 0.95
decodeStringMethod · 0.95

Calls 2

getBytesMethod · 0.65
getMessageMethod · 0.65

Tested by

no test coverage detected