@Test public void writesInputStreamToOutputStream() throws Exception { InputStream source = new ByteArrayInputStream(testContent); ByteArrayOutputStream out = new ByteArrayOutputStream(); inputStreamEntityProvider.writeTo(source, InputStream.class, null, null, null, null, out); assertArrayEquals(testContent, out.toByteArray()); }
@Override public void writeTo(InputStream in, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException { try { ByteStreams.copy(in, entityStream); } finally { in.close(); } }
InputStreamEntityProvider implements EntityProvider<InputStream> { @Override public void writeTo(InputStream in, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException { try { ByteStreams.copy(in, entityStream); } finally { in.close(); } } }
InputStreamEntityProvider implements EntityProvider<InputStream> { @Override public void writeTo(InputStream in, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException { try { ByteStreams.copy(in, entityStream); } finally { in.close(); } }  }
InputStreamEntityProvider implements EntityProvider<InputStream> { @Override public void writeTo(InputStream in, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException { try { ByteStreams.copy(in, entityStream); } finally { in.close(); } }  @Override boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override InputStream readFrom(Class<InputStream> type,
                                Type genericType,
                                Annotation[] annotations,
                                MediaType mediaType,
                                MultivaluedMap<String, String> httpHeaders,
                                InputStream entityStream); @Override long getSize(InputStream t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override void writeTo(InputStream in,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream); }
InputStreamEntityProvider implements EntityProvider<InputStream> { @Override public void writeTo(InputStream in, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException { try { ByteStreams.copy(in, entityStream); } finally { in.close(); } }  @Override boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override InputStream readFrom(Class<InputStream> type,
                                Type genericType,
                                Annotation[] annotations,
                                MediaType mediaType,
                                MultivaluedMap<String, String> httpHeaders,
                                InputStream entityStream); @Override long getSize(InputStream t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override void writeTo(InputStream in,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream);  }