/**
* 读取子线程,完成实际读取
*
*/
class SubReadThread extends Thread {
int count = 0;
StringBuffer sb = new StringBuffer();
public void read() {
try {
char c;
int code = -1;
boolean ansiControl = false;
boolean start = true;
while ((code = (in.read())) != -1) {
count++;
c = (char) code;
if (c == '\033') {
ansiControl = true;
int code2 = in.read();
char cc = (char) code2;
count++;
if (cc == '[' || cc == '(') {
}
}
if (!ansiControl) {
if (c == '\r') {
String olds = new String(sb.toString().getBytes(
ORIG_CODEC), TRANSLATE_CODEC);
System.out.println(olds);
sb.delete(0, sb.length());
} else if (c == '\n')
;
else
sb.append(c);
}
if (ansiControl) {
if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')
|| c == '"') {
ansiControl = false;
}
}
}
} catch (Exception e) {
}
}
public void run() {
read();
}
}
}