Answer the question
In order to leave comments, you need to log in
[[+content_image]]
How to link "bytes getBytes()" in Java and "bytearray()" in python?
Hello ,
I was looking for an equivalent for byte[] getBytes()
in python.
I understand that this is a bytearray, but getBytes() gives bytes like this:
[[email protected] (That is, 0x1ce59895 ???), and bytearray is 115 114 95 115 104 97 104
Like this to tie?
Answer the question
In order to leave comments, you need to log in
String str = new String("Какая-то строка");
byte[] bStr = str.getBytes();
System.out.println(Arrays.toString(bStr));
The question is not clear.
What do you want to link exactly?
From python to transfer bytes to java?
or read bytes in java just like in python?
or read bytes in python as in java?
Where are you reading the bytes from?
How should bytes be represented for your task?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question