KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > modfact > jmi > generator > JarGenerator


1 package org.objectweb.modfact.jmi.generator;
2
3
4 import java.io.*;
5
6 public abstract class JarGenerator implements Generator {
7
8     protected PrintStream out;
9
10
11     public void setOutput(OutputStream stream) throws java.io.IOException JavaDoc {
12         out = new PrintStream(stream);
13     }
14
15     protected void writeEntry(String JavaDoc entryName , ByteArrayOutputStream data) throws java.io.IOException JavaDoc {
16         if (data.size()!=0) {
17           out.println("//--- Entry " +entryName +"---" );
18           out.write( data.toByteArray() , 0 , data.size() );
19           out.println();
20         }
21     }
22
23
24
25
26 }
27
Popular Tags