Java Read Byte Of Jsonstring

[Solved] Java Read Byte Of Jsonstring | Kotlin - Code Explorer | yomemimo.com
Question : java read byte[] of jsonString

Answered by : chalita-martangka

@Test
public void whenDecodeWithCharset_thenOK() { byte[] byteArrray = { 72, 101, 108, 108, 111, 32, -10, 111, 114, 108, -63, 33 }; Charset charset = StandardCharsets.US_ASCII; String string = charset.decode(ByteBuffer.wrap(byteArrray)) .toString(); assertEquals("Hello �orl�!", string);
}

Source : https://www.baeldung.com/java-string-to-byte-array | Last Update : Mon, 18 Apr 22

Answers related to java read byte of jsonstring

Code Explorer Popular Question For Kotlin