ByteArrayOutputStream os = new ByteArrayOutputStream();
p.writeTo(new byte[]{'h', 'i'}, null, null, null, null, null, os);
assertTrue(Arrays.equals(new String("hi").getBytes(), os.toByteArray()));
ByteArrayInputStream is = new ByteArrayInputStream("hi".getBytes());
os = new ByteArrayOutputStream();
p.writeTo(is, null, null, null, null, null, os);
assertTrue(Arrays.equals(os.toByteArray(), new String("hi").getBytes()));
Reader r = new StringReader("hi");
os = new ByteArrayOutputStream();
p.writeTo(r, null, null, null, MediaType.valueOf("text/xml"), null, os);