1 16 17 package com.jaspersoft.jasperserver.ws.axis2; 18 19 import java.io.IOException ; 20 import javax.activation.DataSource ; 21 import java.io.ByteArrayInputStream ; 22 23 27 public class Axis2ByteArrayDataSource implements DataSource { 28 29 private byte[] byteArray = null; 30 private String name = ""; 31 32 33 public Axis2ByteArrayDataSource(String name, byte[] byteArray) { 34 this.name = name; 35 this.byteArray = byteArray; 36 } 37 38 public java.io.InputStream getInputStream() throws IOException { 39 return new ByteArrayInputStream (byteArray); 40 } 41 42 public java.io.OutputStream getOutputStream() throws IOException { 43 throw new java.io.IOException (); 44 } 45 46 public String getContentType() { 47 return "application/octet-stream"; 48 } 49 50 public String getName() { 51 return name; 52 53 } 54 55 } 56 | Popular Tags |