1 11 package org.jboss.portal.server.output; 12 13 import org.jboss.portal.server.output.Result; 14 import org.jboss.portal.server.WindowContext; 15 16 22 public class StreamResult extends Result 23 { 24 25 private String contentType; 26 private byte[] bytes; 27 28 public StreamResult(WindowContext producer, String contentType, byte[] bytes) 29 { 30 super(producer); 31 if (contentType == null) 32 { 33 throw new IllegalArgumentException ("Content type cannot be null"); 34 } 35 if (bytes == null) 36 { 37 throw new IllegalArgumentException ("Bytes cannot be null"); 38 } 39 this.contentType = contentType; 40 this.bytes = bytes; 41 } 42 43 public String getContentType() 44 { 45 return contentType; 46 } 47 48 public byte[] getBytes() 49 { 50 return bytes; 51 } 52 } 53 | Popular Tags |