I am not sure that it it is the biggest problem in your code but you can try to optimize by not using a string class but char[].
char[] resultTab=new char[Integer.MAX_VALUE];
int i=0;
while ((resultTab[i] = in.read()) != -1) {
i++;
}
String result = String.copyValueOf(resultTab, 0, i);
In place of Integer.MAX_VALUE, you put the lenght estimate of your string. (a bit more, if your not sure let it)
If you are using a string your aplication have to alocate new memory when your text became bigger, with a char [], it will alocate memory only once.
Tell me if it's work, i am interest by the result.