62,621
社区成员
发帖
与我相关
我的任务
分享
明白
我就一个java新手。
不知道怎么把转换成的int写到一个int数组中,求教
你是大智若愚吗
try{
FileInputStream readFile=new FileInputStream("D:/h.bin");
DataInputStream dos=new DataInputStream(readFile);
byte[] i=new byte[4];
int readI;
while((readI=dos.read(i))!=-1){
byte byte1 = i[0];
byte byte2 = i[1];
byte byte3 = i[2];
byte byte4 = i[3];
int real=(byte1& 0xff)<<0 |(byte2& 0xff)<<8 | (byte3& 0xff)<< 16 |(byte4& 0xff)<<24;
System.out.println(real);
}
dos.close();

