class BufferReader extends AbstractReader {

	public Buffer getNextBuffer() throws IOException, InterruptedException {
		while (true) {
			final BufferOrEvent bufferOrEvent = inputGate.getNextBufferOrEvent();

			if (bufferOrEvent.isBuffer()) {
				return bufferOrEvent.getBuffer();
			}
			else {
				if (handleEvent(bufferOrEvent.getEvent())) {
					return null;
				}
			}
		}
	}

	public  BufferReader(InputGate gate);

}