org.abstracthorizon.danube.support.logging
Class DirectionalLoggingInputStream
java.lang.Object
java.io.InputStream
org.abstracthorizon.danube.support.logging.LoggingInputStream
org.abstracthorizon.danube.support.logging.DirectionalLoggingInputStream
- All Implemented Interfaces:
- Closeable
public class DirectionalLoggingInputStream
- extends LoggingInputStream
Outputs reading from the input stream to log output stream showing directional marks ">".
Given input stream read bytes are duplicated to log stream.
- Author:
- Daniel Sendula
Field Summary |
protected boolean |
flag
Internal flag to show when to output directional char |
Method Summary |
static boolean |
output(boolean flag,
OutputStream out,
char direction,
byte[] buf,
int off,
int len)
Outputs part of an array scanning it for LF and sending direction chars accodingly |
static boolean |
output(boolean flag,
OutputStream out,
char direction,
int i)
Outputs a byte making sure that direction character is printed too |
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
flag
protected boolean flag
- Internal flag to show when to output directional char
DirectionalLoggingInputStream
public DirectionalLoggingInputStream(InputStream inputStream,
OutputStream logOutputStream)
- Constructor
- Parameters:
inputStream
- input stream to be loggedlogOutputStream
- log output stream
read
public int read()
throws IOException
- Overrides:
read
in class LoggingInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class LoggingInputStream
- Throws:
IOException
output
public static boolean output(boolean flag,
OutputStream out,
char direction,
int i)
throws IOException
- Outputs a byte making sure that direction character is printed too
- Parameters:
flag
- flagout
- output streamdirection
- direction chari
- byte to be sent to output stream
- Returns:
- flag
- Throws:
IOException
- io exception
output
public static boolean output(boolean flag,
OutputStream out,
char direction,
byte[] buf,
int off,
int len)
throws IOException
- Outputs part of an array scanning it for LF and sending direction chars accodingly
- Parameters:
flag
- flagout
- output streamdirection
- directionbuf
- buffer to be sent to output streamoff
- offset in the bufferlen
- length of data to be sent
- Returns:
- flag
- Throws:
IOException
- io exception
Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.