6
有沒有可能我的後續BufferedReader能夠把輸入直接放到byte []中?BufferedReader直接到byte []
public static Runnable reader() throws IOException {
Log.e("Communication", "reader");
din = new DataInputStream(sock.getInputStream());
brdr = new BufferedReader(new InputStreamReader(din), 300);
boolean done = false;
while (!done) {
try {
char[] buffer = new char[200];
int length = brdr.read(buffer, 0, 200);
String message = new String(buffer, 0, length);
btrar = message.getBytes("ISO-8859-1");
int i=0;
for (int counter = 0; counter < message.length(); counter++) {
i++;
System.out.println(btrar[counter] + " = " + " btrar " + i);
}
...
這是讀者的一部分,請看看。
我想直接輸入到btrar,
所以它的錯誤處理? – Ekonion 2013-02-27 08:17:09
@Ekonion:是的,當你想要二進制數據是錯誤的,使用'Reader'。 – 2013-02-27 08:18:20
ah ^^ thx,我會嘗試:D – Ekonion 2013-02-27 08:19:58