大家看看下面选什么,有些不确定。

shirui8653719 2013-12-26 10:13:07
当已经创建Socket对象s来连接到远程服务器,下列哪个是最合适的方法来立即从socket读取ASCII数据?
A. InputStream in=s.getInputStream();

B. DataInputStram in=new DataInputStream(s.getInputStream());

C. ByteArrayInputStream in=new ByteArrayInputStream(s.getInputStream());

D. BufferedReader in=new BufferedReader(new InputStreamReader(s.getInputStream()));

E. BufferedReader in=new BufferedReader (new InputStreamReader(s.getInputStream()),‘8859-1’);
...全文
166 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
随便猜一个呗
solomon5926 2013-12-26
  • 打赏
  • 举报
回复
引用 3 楼 remember1989 的回复:
没事选最长的吧。
为啥不选最短的?
shirui8653719 2013-12-26
  • 打赏
  • 举报
回复
引用 4 楼 zk110913230 的回复:
选D吧,有点像
shirui8653719 2013-12-26
  • 打赏
  • 举报
回复
引用 3 楼 remember1989 的回复:
没事选最长的吧。
zk110913230 2013-12-26
  • 打赏
  • 举报
回复
选D吧,有点像
remember1989 2013-12-26
  • 打赏
  • 举报
回复
没事选最长的吧。
mmy_yc 2013-12-26
  • 打赏
  • 举报
回复
gloomyfish 2013-12-26
  • 打赏
  • 举报
回复
D E那个编码格式好像要取决于对方是否有编码!

62,621

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧