I wrote a code writing 8 different values of sine in byte form (using .getbytes) into a text file.
After I run it a file is created containing the following: [B@5f18cd5 [B@1c515979 [B@20c92575 [B@75ba3523 [B@f4c7f77 [B@67446579 [B@3b621fe6 [B@271c537f
So far so good...
I'd now like to inverse this whole process in another Java project. For this I need to know how to turn for example [B@1c515979 back to it's initial value which is 0.7071.
I tried to use
System.out.println("Text [Byte Format] : " + bytes.toString());
with which I hoped to convert the byte code back to string. The problem though, is that since I'm reading from a text file I guess the read data is string anyway, so actually I'm just turning strings into strings.
This is my status quo... Anyone got an idea?
Thanks for listening.
getBytes()on a String? Then you should usenew String(bytes);instead ofbytes.toString();.toStringmethod.