01: package org.xsocket.web.http;
02:
03: import java.io.IOException;
04: import java.net.SocketTimeoutException;
05: import java.nio.ByteBuffer;
06: import java.nio.channels.ReadableByteChannel;
07: import java.nio.channels.WritableByteChannel;
08:
09: import org.xsocket.ClosedConnectionException;
10: import org.xsocket.IDataSource;
11: import org.xsocket.MaxReadSizeExceededException;
12:
13: public interface INonBlockingReadableChannel extends IDataSource,
14: ReadableByteChannel {
15:
16: public static final int INITIAL_RECEIVE_TIMEOUT = Integer.MAX_VALUE;
17:
18: /**
19: * get the number of available bytes to read
20: *
21: * @return the number of available bytes
22: */
23: public int getNumberOfAvailableBytes();
24:
25: public ByteBuffer[] readByteBuffer() throws IOException,
26: ClosedConnectionException, SocketTimeoutException,
27: MaxReadSizeExceededException;
28:
29: public byte[] readBytes() throws IOException,
30: ClosedConnectionException, SocketTimeoutException,
31: MaxReadSizeExceededException;
32:
33: public long transferTo(WritableByteChannel outputChannel)
34: throws ClosedConnectionException, IOException,
35: SocketTimeoutException;
36:
37: public boolean isRead();
38: }
|