1 18 package org.ofbiz.content.openoffice; 19 20 import java.io.ByteArrayOutputStream ; 21 22 import com.sun.star.io.XSeekable; 23 import com.sun.star.io.XOutputStream; 24 import com.sun.star.io.BufferSizeExceededException; 25 import com.sun.star.io.NotConnectedException; 26 27 28 37 38 public class OpenOfficeByteArrayOutputStream extends ByteArrayOutputStream implements XOutputStream { 39 40 public static final String module = OpenOfficeByteArrayOutputStream.class.getName(); 41 42 public OpenOfficeByteArrayOutputStream() { 43 super(); 44 } 46 47 public OpenOfficeByteArrayOutputStream(int arg0) { 48 super(arg0); 49 } 51 52 53 public void writeBytes(byte[] buf) throws BufferSizeExceededException, NotConnectedException, com.sun.star.io.IOException 54 { 55 try { 56 write(buf); 57 } catch ( java.io.IOException e ) { 58 throw(new com.sun.star.io.IOException(e.getMessage())); 59 } 60 } 61 62 public void closeOutput() throws BufferSizeExceededException, NotConnectedException, com.sun.star.io.IOException 63 { 64 try { 65 super.flush(); 66 close(); 67 } catch ( java.io.IOException e ) { 68 throw(new com.sun.star.io.IOException(e.getMessage())); 69 } 70 } 71 72 public void flush() 73 { 74 try { 75 super.flush(); 76 } catch ( java.io.IOException e ) { 77 } 78 } 79 80 } 81 | Popular Tags |