寫了2個int共8字節,一個long8字節,一個double8字節,2個“中國”(utf-8共6字節,utf-16be共4字節)為什么會打印出來36個字節
dos.writeInt(10);
dos.writeInt(-10);
dos.writeLong(10l);
dos.writeDouble(10.5);
//采用utf-8編碼寫入中國
dos.writeUTF("中國");
//utf-16be
dos.writeChars("中國");
dos.writeInt(10);
dos.writeInt(-10);
dos.writeLong(10l);
dos.writeDouble(10.5);
//采用utf-8編碼寫入中國
dos.writeUTF("中國");
//utf-16be
dos.writeChars("中國");
2019-10-21
舉報
2019-11-02
00? 06 --->? 這兩字節表示的是字符串s占6個字節
e4? b8? ad? e5? 9b? bd? --->"中國"的utf-8編碼
4e? 2d? 56? fd? --->"中國"的utf-16be編碼