class ByteEntityProvider implements EntityProvider<byte[]> {

    @Override
    public void writeTo(byte[] bytes,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream) throws IOException {
        entityStream.write(bytes);
    }

}