|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jini.phoenix.PipeWriter
class PipeWriter
PipeWriter plugs together two pairs of input and output streams by providing readers for input streams and writing through to appropriate output streams. Both output streams are annotated on a per-line basis.
Field Summary | |
---|---|
private ByteArrayOutputStream |
bufOut
stream used for buffering lines |
private int |
cLast
count since last separator |
private byte[] |
currSep
current chunk of input being compared to lineSeparator. |
private Object[] |
date
|
private String |
execString
|
private static String |
format
|
private static MessageFormat |
formatter
|
private InputStream |
in
|
private static String |
lineSeparator
|
private static int |
lineSeparatorLength
|
private PrintWriter |
out
|
Constructor Summary | |
---|---|
private |
PipeWriter(InputStream in,
OutputStream out,
String name,
String tag)
Create a new PipeWriter object. |
Method Summary | |
---|---|
private String |
createAnnotation()
Create an annotation string to be printed out after a new line and end of stream. |
(package private) static void |
plugTogetherPair(String name,
InputStream in,
OutputStream out,
InputStream in1,
OutputStream out1)
Allow plugging together two pipes at a time, to associate output from an exec'ed process. |
void |
run()
Create a thread to listen and read from input stream, in. |
private void |
write(byte b)
Write a byte of data to the stream. |
private void |
write(byte[] b,
int off,
int len)
Write a subarray of bytes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final ByteArrayOutputStream bufOut
private int cLast
private final byte[] currSep
private final PrintWriter out
private final InputStream in
private final String execString
private final Object[] date
private static final String lineSeparator
private static final int lineSeparatorLength
private static final String format
private static final MessageFormat formatter
Constructor Detail |
---|
private PipeWriter(InputStream in, OutputStream out, String name, String tag)
in
- input stream from which pipe input flowsout
- output stream to which log messages will be sentname
- name of the processtag
- name of the stream (out or err)Method Detail |
---|
public void run()
run
in interface Runnable
private void write(byte[] b, int off, int len) throws IOException
IOException
private void write(byte b) throws IOException
IOException
private String createAnnotation()
static void plugTogetherPair(String name, InputStream in, OutputStream out, InputStream in1, OutputStream out1)
name
- name of the processin
- input stream from which pipe input comesout
- output stream to which log messages will be sentin1
- input stream from which pipe input comesout1
- output stream to which log messages will be sent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |