当前位置: 技术问答>java相关
warning: readLine() in java.io.DataInputStream has been deprecated请问
来源: 互联网 发布时间:2015-04-27
本文导语: warning: readLine() in java.io.DataInputStream has been deprecated 我传输的是二进制格式 该用哪个替换readLine()???? 多谢了 | to iloveyouonlyonce: String s = " "; s = s + Character.forDigit...
warning: readLine() in java.io.DataInputStream has been deprecated
我传输的是二进制格式
该用哪个替换readLine()????
多谢了
|
to iloveyouonlyonce:
String s = " ";
s = s + Character.forDigit(data >> 4 & 0xf, 16);
s = s + Character.forDigit(data & 0xf, 16);
return s;
s 现在是 16 进制表示的数,是不是你想要的格式?
String s = " ";
s = s + Character.forDigit(data >> 4 & 0xf, 16);
s = s + Character.forDigit(data & 0xf, 16);
return s;
s 现在是 16 进制表示的数,是不是你想要的格式?
|
inStream = new DataInputStream(connSock.getInputStream());
String str = inStream.readUTF();
DataInputStream in =new DataInputStream(new FileInputStream ("d:\javacode\source.txt"));
i=0;
while(i>=0)
{
try
{
b=in.readByte(); //每次读8位
System.out.print((char)b); //如何将8位转成16位的字符输出?若那样也应该每次
i++; 读2个字节啊?
}
String str = inStream.readUTF();
DataInputStream in =new DataInputStream(new FileInputStream ("d:\javacode\source.txt"));
i=0;
while(i>=0)
{
try
{
b=in.readByte(); //每次读8位
System.out.print((char)b); //如何将8位转成16位的字符输出?若那样也应该每次
i++; 读2个字节啊?
}