我有一個讀取BINARY文件並將其發送給客戶端的servlet。讀取二進制文件爲byte []並從servlet發送爲char []
byte[] binaryData = FileUtils.readFileToByteArray(path);
response.getWriter().print(new String(binaryData));
它適用於非BINARY文件。當我有一個BINARY文件時,我得到receive file length bigger than origin or received file not the same
。我如何讀取和發送二進制數據?
謝謝。
男人,你太棒了! – 2012-01-31 19:42:46