我:java的輸出十六進制(ByteArrayOutputStream)
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
encoder.encode(question, outputStream);
當System.out.println(outputStream)
打印這個..我看到0►☻☺♣▬♂test some
,我想看到這個HEX像30 04 12 54 33
我怎麼能這樣做?
感謝
我能寫的二進制文件這樣的文件:
File file = new File("out.bin");
FileOutputStream filename = new FileOutputStream(file);
outputStream.writeTo(filename);
這裏看看:http://stackoverflow.com/a/2149927/986169 – giorashc 2012-03-29 12:55:36
我的情況是有辦法解決嗎?只是爲了這個例子..我並不擅長這個,所以......:| – pufos 2012-03-29 13:19:54
我把這個二進制文件寫到'outputStream.writeTo(filename)'這樣的文件中,其中文件是'File file = new File(「out.bin」); FileOutputStream filename = new FileOutputStream(file);' – pufos 2012-03-29 14:55:53