edu.wisc.ssec.mcidasv.jython
Class OutputStreamDemux

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.ByteArrayOutputStream
          extended by edu.wisc.ssec.mcidasv.jython.OutputStreamDemux
All Implemented Interfaces:
Closeable, Flushable

public class OutputStreamDemux
extends ByteArrayOutputStream


Nested Class Summary
protected static class OutputStreamDemux.OutputType
           
 
Field Summary
private  Map<String,Console> consoleMap
           
private  Map<String,Interpreter> interpreterMap
           
private  Map<String,ByteArrayOutputStream> streamMap
           
private  OutputStreamDemux.OutputType type
           
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
OutputStreamDemux()
           
 
Method Summary
 void addStream(Console console, Interpreter interpreter, OutputStreamDemux.OutputType type)
           
 void close()
           
 void flush()
           
private static String id()
           
 void reset()
           
 int size()
           
 byte[] toByteArray()
           
 String toString()
           
 String toString(int hibyte)
          Deprecated. 
 String toString(String charsetName)
           
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 void writeTo(OutputStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

private OutputStreamDemux.OutputType type

streamMap

private final Map<String,ByteArrayOutputStream> streamMap

interpreterMap

private final Map<String,Interpreter> interpreterMap

consoleMap

private final Map<String,Console> consoleMap
Constructor Detail

OutputStreamDemux

public OutputStreamDemux()
Method Detail

id

private static String id()

addStream

public void addStream(Console console,
                      Interpreter interpreter,
                      OutputStreamDemux.OutputType type)

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class ByteArrayOutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
Overrides:
write in class ByteArrayOutputStream

write

public void write(int b)
Overrides:
write in class ByteArrayOutputStream

reset

public void reset()
Overrides:
reset in class ByteArrayOutputStream

size

public int size()
Overrides:
size in class ByteArrayOutputStream

toByteArray

public byte[] toByteArray()
Overrides:
toByteArray in class ByteArrayOutputStream

toString

@Deprecated
public String toString(int hibyte)
Deprecated. 

Overrides:
toString in class ByteArrayOutputStream

toString

public String toString(String charsetName)
                throws UnsupportedEncodingException
Overrides:
toString in class ByteArrayOutputStream
Throws:
UnsupportedEncodingException

writeTo

public void writeTo(OutputStream out)
             throws IOException
Overrides:
writeTo in class ByteArrayOutputStream
Throws:
IOException

toString

public String toString()
Overrides:
toString in class ByteArrayOutputStream