当前页面:
在线文档首页 >
JBoss 4.0.1 sp1 common API Documentation 英文版文档
NotifyingBufferedInputStream (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档
org.jboss.util.stream
Class NotifyingBufferedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.BufferedInputStream
org.jboss.util.stream.NotifyingBufferedInputStream
- public class NotifyingBufferedInputStream
- extends BufferedInputStream
A buffered input stream that notifies every "chunk"
- Version:
- $Revision: 1.2 $
- Author:
- Adrian Brock
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NotifyingBufferedInputStream
public NotifyingBufferedInputStream(InputStream is,
int size,
int chunkSize,
StreamListener listener)
- Construct a notifying buffered inputstream.
The listener is notified once every chunk.
- Parameters:
is
- the input stream to be bufferedsize
- the buffer sizechunkSize
- the chunk sizelistener
- the listener to notify
- Throws:
IllegalArgumentException
- for a size <= 0 or chunkSize <= size
setStreamListener
public void setStreamListener(StreamListener listener)
read
public int read()
throws IOException
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Throws:
IOException
checkNotification
public void checkNotification(int result)
- Checks whether a notification is required and
notifies as appropriate
- Parameters:
result
- the number of bytes read
Copyright © 2002 JBoss Group, LLC. All Rights Reserved.