1 17 18 package org.apache.catalina.ssi; 19 20 import java.io.ByteArrayOutputStream ; 21 import javax.servlet.ServletOutputStream ; 22 23 24 32 public class ByteArrayServletOutputStream extends ServletOutputStream { 33 36 protected ByteArrayOutputStream buf = null; 37 38 39 42 public ByteArrayServletOutputStream() { 43 buf = new ByteArrayOutputStream (); 44 } 45 46 47 50 public byte[] toByteArray() { 51 return buf.toByteArray(); 52 } 53 54 55 60 public void write(int b) { 61 buf.write(b); 62 } 63 } 64 | Popular Tags |