@Test
public void test() throws Exception {

  InputStream is = new ByteArrayInputStream("abc".getBytes());
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  InputStreamEntity i = new InputStreamEntity(is);
  i.write(baos);
  baos.close();
  assertEquals(new String(baos.toByteArray()), "abc");
  is = new ByteArrayInputStream("abc".getBytes());
  baos = new ByteArrayOutputStream();
  i = new InputStreamEntity(is, 1, 1);
  i.write(baos);
  baos.close();
  assertEquals(baos.toByteArray()[0], 'b');
}