求答疑~从socket中获取数据流(InputStream)后,为什么还需要转成DataInputStream,才能保存到硬盘中?
如题,请解释为什么要进行如下的操作,
netIn = acceptfilesocket.getInputStream();
in = new DataInputStream(new BufferedInputStream(netIn));
谢谢!
代码如下:
socket acceptfilesocket;javasocket InputStream? DataInputStream BufferedInputStream
InputStream netIn = null;
InputStream in = null;
try
{
netIn = acceptfilesocket.getInputStream();
in = new DataInputStream(new BufferedInputStream(netIn));
} catch (IOException e1)
{
System.out.print("接收文件创建网络接受流接受服务器文件数据异常");
}