MessageBodyReader p = new BinaryDataProvider();
byte[] bytes = (byte[])p.readFrom(byte[].class, null, null,
null, null, new ByteArrayInputStream("hi".getBytes()));
assertTrue(Arrays.equals(new String("hi").getBytes(), bytes));
InputStream is = (InputStream)p.readFrom(InputStream.class, null, null, null, null,
new ByteArrayInputStream("hi".getBytes()));
bytes = IOUtils.readBytesFromStream(is);
assertTrue(Arrays.equals(new String("hi").getBytes(), bytes));
Reader r = (Reader)p.readFrom(Reader.class, null, null,