I have a character array that can hold maximum 50000 characters at a time. Contents of this array are coming through socket connections. However it is not guaranteed that th
something like that should work too :
public String readBufferUpdate() throws IOException {
char[] buffer =new char[50000];
is.read(buffer);
return new String(ArrayUtils.removeElements(buffer, ''));
}
Doc here : http://commons.apache.org/proper/commons-lang/javadocs/api-3.1/org/apache/commons/lang3/ArrayUtils.html#removeElements(char[], char...)