public class RotateStream extends StreamImpl
_nullPath, _path
Modifier and Type | Method and Description |
---|---|
boolean |
canWrite()
True if the stream can write
|
static void |
clear()
Clears the streams.
|
void |
close()
The close call does nothing since the rotate stream is shared for
many logs.
|
static RotateStream |
create(Path path)
Returns the rotate stream corresponding to this path
|
static RotateStream |
create(java.lang.String path)
Returns the rotate stream corresponding to this path
|
void |
finalize() |
void |
flush()
Flushes the underlying stream.
|
Path |
getPath()
Returns the Path associated with the stream.
|
AbstractRolloverLog |
getRolloverLog()
Returns the rollover log.
|
WriteStream |
getStream()
Gets the current write stream
|
void |
init()
Initialize the stream, setting any logStream, System.out and System.err
as necessary.
|
void |
setArchiveFormat(java.lang.String format)
Sets the archive format.
|
void |
setMaxRolloverCount(int count)
Sets the maximum number of rolled logs.
|
void |
setRolloverPeriod(long period)
Sets the log rollover period, rounded up to the nearest hour.
|
void |
setRolloverSize(long size)
Sets the log rollover size in bytes.
|
void |
write(byte[] buffer,
int offset,
int length,
boolean isEnd)
Writes to the stream
|
canRead, clearWrite, closeWrite, flushBuffer, flushToDisk, getAttribute, getAttributeNames, getAvailable, getFlushOnNewline, getNewline, getReadBuffer, getReadPosition, hasSkip, isClosed, isEof, isMmapEnabled, isSendfileEnabled, read, readNonBlock, readTimeout, removeAttribute, seekEnd, seekStart, setAttribute, setPath, setWriteEncoding, skip, write, writeMmap, writeSendfile
public static RotateStream create(Path path)
public static RotateStream create(java.lang.String path) throws ConfigException
ConfigException
public static void clear()
public AbstractRolloverLog getRolloverLog()
public void setMaxRolloverCount(int count)
public void setRolloverPeriod(long period)
period
- the new rollover period in milliseconds.public void setRolloverSize(long size)
public void setArchiveFormat(java.lang.String format)
format
- the archive format.public void init() throws java.io.IOException
java.io.IOException
public Path getPath()
getPath
in class StreamImpl
public boolean canWrite()
canWrite
in class StreamImpl
public void write(byte[] buffer, int offset, int length, boolean isEnd) throws java.io.IOException
write
in class StreamImpl
buffer
- the byte array to write.offset
- the offset into the byte array.length
- the number of bytes to write.isEnd
- true when the write is flushing a close.java.io.IOException
public WriteStream getStream()
public void flush() throws java.io.IOException
flush
in class StreamImpl
java.io.IOException
public void close()
close
in class StreamImpl
public void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable