System.out.println()不写整个字符串! [英] System.out.println() Not writing entire string!

查看:127
本文介绍了System.out.println()不写整个字符串!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试获取字节流以使用String(responseBytes)写出字节时

When i try to get the bytestream to write out the bytes using String(responseBytes)

in_ = new DataInputStream(eiscpSocket_.getInputStream());
       byte [] responseBytes = new byte[64] ;
       int numBytesReceived = 0;

       numBytesReceived = in_.read(responseBytes);
       retVal = new String(responseBytes); //new String(responseBytes);
       System.out.println("received " + numBytesReceived + " bytes: \"" + responseBytes +"  "+ retVal + " \"" );



但是System.out.println("received" + numBytesReceived +"bytes:\""+ responseBytes +""+ retVal +" \")在retVal之后甚至整个retVal之后都不会打印任何内容.
我得到此输出



But System.out.println("received " + numBytesReceived + " bytes: \"" + responseBytes +" "+ retVal + " \"" ) does not print anything after retVal and not even the whole retVal.

I Get this output

received 46 bytes: "[B@137c60d  ISCP




使用程序从我的onkyo接收者那里得到响应

为什么我不能打印我的字节响应?




using this program to get a response from my onkyo reciever

why cant i print my bytes response?

推荐答案

包围字节然后打印它们,为我解决了!
Looped the bytes and then printed them, solved it for me!


这篇关于System.out.println()不写整个字符串!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆