Java byte[] to string conversion outputting byte
问题 In my code, I am sending a txt file encoded into a byte array over the internet, and then converting the message back on the other side and displaying it. The problem is that when I try displaying it, it always comes out as "[B@1ef9f1d" or "[B@1764be1" etc. This is what recieves the data private void parsePacket(byte[] data, InetAddress address, int port) { String datasent[] = (new String(data).trim()).split(","); String type = datasent[0]; String message = datasent[1]; switch(type){//Data we