/**
* Returns a reader wrapping the given reader that only reads half of the maximum number of
* characters that it could read in read(char[], int, int).
*/
private static Reader newNonBufferFillingReader(Reader reader) {
return new FilterReader(reader) {
@Override
public int read(char[] cbuf, int off, int len) throws IOException {
// if a buffer isn't being cleared correctly, this method will eventually start being called
// with a len of 0 forever
if (len <= 0) {