net.aerith.misao.util
Class StreamSkipTimer

java.lang.Object
  |
  +--net.aerith.misao.util.StreamSkipTimer

public class StreamSkipTimer
extends java.lang.Object

The StreamSkipTimer is a class to skip some bytes for the specified input stream or reader within the specified time. When the skip method cannot skip the specified bytes within the specified time, it throws an IOException.


Field Summary
protected  java.io.BufferedReader reader
          The reader.
protected  long start_time
          The time when the skip method returns 0 for the first time.
protected  java.io.DataInputStream stream
          The input stream.
protected  long time_millis
          The time to wait in milli second.
 
Constructor Summary
StreamSkipTimer(java.io.BufferedReader reader, long time_millis)
          Constructs a StreamSkipTimer.
StreamSkipTimer(java.io.DataInputStream stream, long time_millis)
          Constructs a StreamSkipTimer.
 
Method Summary
 void skip(long bytes)
          Skips the specified bytes.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

stream

protected java.io.DataInputStream stream
The input stream.

reader

protected java.io.BufferedReader reader
The reader.

time_millis

protected long time_millis
The time to wait in milli second.

start_time

protected long start_time
The time when the skip method returns 0 for the first time.
Constructor Detail

StreamSkipTimer

public StreamSkipTimer(java.io.DataInputStream stream,
                       long time_millis)
Constructs a StreamSkipTimer.
Parameters:
stream - the input stream.
time_millis - the time to wait for the skip method in milli second.

StreamSkipTimer

public StreamSkipTimer(java.io.BufferedReader reader,
                       long time_millis)
Constructs a StreamSkipTimer.
Parameters:
reader - the reader.
time_millis - the time to wait for the skip method in milli second.
Method Detail

skip

public void skip(long bytes)
          throws java.io.IOException
Skips the specified bytes.
Parameters:
bytes - the bytes to skip.
Throws:
java.io.IOException - if the skip method cannot skip the specified bytes within the specified time.