第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

結(jié)果不對?

此處我的輸出結(jié)果:

41 00 00 d6 b9

為什么會這樣?

附代碼:

public?static?void?printHex(String?fileName)?throws?IOException{
		//把文件作為字節(jié)流進行讀操作
		FileInputStream?in=new?FileInputStream(fileName);
		int?b;
		int?i=1;
		while((b=in.read())!=-1){
			if(in.read()?<=?0xf)
				System.out.print("0");
			System.out.print(Integer.toHexString(b)+"?");
			if(i++%10==0)
				System.out.println();
		}
		in.close();
	}
public?class?FileOutDemo1?{
	public?static?void?main(String[]?args)?throws?IOException{
		//如果該文件不存在,則直接創(chuàng)建;如果存在,刪除后創(chuàng)建
		FileOutputStream?out=new?FileOutputStream("demo/out.dat");
		out.write('A');//寫出了'A'的低八位
		out.write('B');//寫出了'B'的低八位
		int?a=10;//write只能寫八位,那么寫一個int需要寫4次每次8位
		out.write(a?>>>?24);
		out.write(a?>>>?16);
		out.write(a?>>>?8);
		out.write(a);
		byte[]?gbk="中國".getBytes("gbk");
		out.write(gbk);
		out.close();
		
		IOUtil.printHex("demo/out.dat");
	}

}


正在回答

2 回答

還在嗎?

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

wshyzx 提問者

????
2016-09-08 回復(fù) 有任何疑惑可以回復(fù)我~

第七行的if語句代碼 寫錯啦 你又讀了一次

應(yīng)該這樣寫

??if(b?<=?0xf)
????????System.out.print("0");


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

wshyzx 提問者

為什么會導(dǎo)致這個結(jié)果?
2016-08-06 回復(fù) 有任何疑惑可以回復(fù)我~
#2

susu_name 回復(fù) wshyzx 提問者

讀了兩次 肯定少一半、、
2016-08-09 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

結(jié)果不對?

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號