public byte[] readAll() throws IOException {
    if (pos == 0 && count == buf.length) {
      pos = count;
      return buf;
    }
    byte[] ret = new byte[count - pos];
    super.read(ret);
    return ret;
  }
@Test
  public void testReadAll() throws IOException {
    assertEquals(TEST_DATA.length, exposedStream.available());
    byte[] data = exposedStream.readAll();
    assertArrayEquals(TEST_DATA, data);
    assertSame(TEST_DATA, data);
    assertEquals(0, exposedStream.available());
  }