@Override
    public int read() throws IOException {
        if (advanceStream()) {
            final int value = buffer[bufferStart];
            incrementRead();
            return value;
        }
        return -1;
    }
@Test()
    public void testRead_3args() throws Exception {
        byte[] input = new byte[2048];
        Arrays.fill(input, (byte) ' ');
        input[0] = '{';
        input[2047] = '}';
        byte[] results = new byte[2050];
        byte[] expected = new byte[2050];
        Arrays.fill(expected, (byte) ' ');
        expected[0] = '[';
        expected[1] = '{';
        expected[2048] = '}';
        expected[2049] = ']';
        try (InputStream sample = new ByteArrayInputStream(input);
                JsonArrayFixingInputStream instance = new JsonArrayFixingInputStream(sample)) {
            int read = 0;
            int pos = 0;
            while (read >= 0) {
                read = instance.read(results, pos, 2050 - pos);
                pos += read;
            }
            Assert.assertArrayEquals(expected, results);
        }
    }