}
@Test
public void testInputStreamBody() throws Exception {
final byte[] stuff = "Stuff".getBytes("US-ASCII");
final InputStreamBody b1 = new InputStreamBody(new ByteArrayInputStream(stuff), "stuff");
Assert.assertEquals(-1, b1.getContentLength());
Assert.assertNull(b1.getCharset());
Assert.assertEquals("stuff", b1.getFilename());
Assert.assertEquals("application/octet-stream", b1.getMimeType());
Assert.assertEquals("application", b1.getMediaType());
Assert.assertEquals("octet-stream", b1.getSubType());
Assert.assertEquals(MIME.ENC_BINARY, b1.getTransferEncoding());
final InputStreamBody b2 = new InputStreamBody(
new ByteArrayInputStream(stuff), ContentType.create("some/stuff"), "stuff");
Assert.assertEquals(-1, b2.getContentLength());
Assert.assertNull(b2.getCharset());
Assert.assertEquals("stuff", b2.getFilename());
Assert.assertEquals("some/stuff", b2.getMimeType());
Assert.assertEquals("some", b2.getMediaType());
Assert.assertEquals("stuff", b2.getSubType());
Assert.assertEquals(MIME.ENC_BINARY, b2.getTransferEncoding());
}