Compoze Software, Inc.

com.compoze.util
Class TimedFlushOutputStream


java.lang.Object

  |

  +--java.io.OutputStream

        |

        +--java.io.FilterOutputStream

              |

              +--java.io.BufferedOutputStream

                    |

                    +--com.compoze.util.TimedFlushOutputStream

All Implemented Interfaces:
java.io.Serializable

public class TimedFlushOutputStream
extends java.io.BufferedOutputStream
implements java.io.Serializable

This class starts a background thread which flushes the underlying BufferedOutputStream at a given rate. The permission must be available to create a new thread.

See Also:
BufferedOutputStream, Serialized Form

Fields inherited from class java.io.BufferedOutputStream
buf, count
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
TimedFlushOutputStream(java.io.OutputStream os, int iSize, long lFlushMillis)
          Constructor.
TimedFlushOutputStream(java.io.OutputStream os, long lFlushMillis)
          Constructor.
 
Method Summary
 void start()
          Create and start a new flush thread.
 void stop()
          Stop and destroy the flush thread.
 
Methods inherited from class java.io.BufferedOutputStream
flush, write, write
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimedFlushOutputStream


public TimedFlushOutputStream(java.io.OutputStream os,
                              long lFlushMillis)
Constructor.
Parameters:
os - underlying output stream
lFlushMillis - flush interval (in milliseconds)

TimedFlushOutputStream


public TimedFlushOutputStream(java.io.OutputStream os,
                              int iSize,
                              long lFlushMillis)
Constructor.
Parameters:
os - underlying output stream
iSize - size of output buffer
lFlushMillis - flush interval (in milliseconds)
Method Detail

stop


public void stop()
Stop and destroy the flush thread.

start


public void start()
Create and start a new flush thread.

Compoze Software, Inc.

Copyright ©1999-2001 Compoze Software, Inc. All rights reserved.