recordingStream = Connection.getInputStream(); for (int i = 0; i < 1; i++) { // 1 раз 1 байт. if (recordingStream.read(buffer, 0, ikk) != -1 && isRecording) { //writer.write(buffer, 0, ikk); String lin = new String(buffer, 0, ikk); //из потока в String(?) прочитался один байт - ikk=1 } } 

Next you need to read lin and output it hex (hex there is: 04 Here is 04 and you need to read it in the next String as text).

Simply put, decode one byte from hex into text.

    1 answer 1

     String inputString = lin; byte[] byteArray = inputString.getBytes(); String xx = Arrays.toString(byteArray); char my = xx.charAt(1); 

    Total: my = 4 That is necessary. Lucky day. But in my opinion is not ergonomic.

    • @Regent is the answer to the question, it's just oddly designed. - PashaPash
    • The @PashaPash first revision of the “answer” to which my comment applied did not resemble the answer from the word “fully”. There are no questions to the current edition (and the second one). - Regent