1 55 56 package org.jboss.axis.message; 57 58 import org.jboss.axis.encoding.SerializationContext; 59 import org.jboss.axis.utils.Messages; 60 import org.jboss.logging.Logger; 61 62 import java.io.IOException ; 63 import java.io.InputStream ; 64 65 66 public class InputStreamBody extends SOAPBodyElementAxisImpl 67 { 68 private static Logger log = Logger.getLogger(InputStreamBody.class.getName()); 69 70 protected InputStream inputStream; 71 72 public InputStreamBody(InputStream inputStream) 73 { 74 this.inputStream = inputStream; 75 } 76 77 public void outputImpl(SerializationContext context) throws IOException 78 { 79 try 80 { 81 byte[] buf = new byte[inputStream.available()]; 82 inputStream.read(buf); 83 String contents = new String (buf); 84 context.writeString(contents); 85 } 86 catch (IOException ex) 87 { 88 throw ex; 89 } 90 catch (Exception e) 91 { 92 log.error(Messages.getMessage("exception00"), e); 93 } 94 } 95 } 96 | Popular Tags |