KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ofbiz > content > openoffice > OpenOfficeByteArrayOutputStream


1 /*
2  * $Id: $
3  *
4  * Copyright 2005-2006 The Apache Software Foundation
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7  * use this file except in compliance with the License. You may obtain a copy of
8  * the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */

18 package org.ofbiz.content.openoffice;
19
20 import java.io.ByteArrayOutputStream JavaDoc;
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 /**
29  * OpenOfficeByteArrayOutputStream Class
30  *
31  * @author <a HREF="mailto:byersa@automationgroups.com">Al Byers</a>
32  * @version $Rev: 5462 $
33  * @since 3.2
34  *
35  *
36  */

37
38 public class OpenOfficeByteArrayOutputStream extends ByteArrayOutputStream JavaDoc implements XOutputStream {
39
40     public static final String JavaDoc module = OpenOfficeByteArrayOutputStream.class.getName();
41     
42     public OpenOfficeByteArrayOutputStream() {
43         super();
44         // TODO Auto-generated constructor stub
45
}
46
47     public OpenOfficeByteArrayOutputStream(int arg0) {
48         super(arg0);
49         // TODO Auto-generated constructor stub
50
}
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 JavaDoc 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 JavaDoc 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 JavaDoc e ) {
77           }
78       }
79
80 }
81
Popular Tags