- if (n > 0) {
- // System.err.printf("available() %d\n", n); System.err.flush();
- if (utf8) {
- if (readBufferUTF8.length < n) {
- // The buffer wasn't big enough, make it huger
- int newSize = Math.max(readBufferUTF8.length * 2, n);
-
- readBufferUTF8 = new char[newSize];
- }
- } else {
- if (readBuffer.length < n) {
- // The buffer wasn't big enough, make it huger
- int newSize = Math.max(readBuffer.length * 2, n);
- readBuffer = new byte[newSize];
- }
- }
+ // System.err.printf("available() %d\n", n); System.err.flush();
+ if (utf8) {
+ if (readBufferUTF8.length < n) {
+ // The buffer wasn't big enough, make it huger
+ int newSizeHalf = Math.max(readBufferUTF8.length, n);