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