/** * This method is used to consume bytes from the provided cursor. * Consuming of bytes from the cursor should be done in such a * way that it does not block. So typically only the number of * ready bytes in the <code>ByteCursor</code> object should be * read. If there are no ready bytes then this will return. * * @param cursor used to consume the bytes from the HTTP pipeline */ public void consume(ByteCursor cursor) throws IOException { ByteCounter counter = new ByteCounter(cursor); while(counter.isReady()) { if(consumer.isFinished()) { break; } consumer.consume(counter); } }
/** * This method is used to consume bytes from the provided cursor. * Consuming of bytes from the cursor should be done in such a * way that it does not block. So typically only the number of * ready bytes in the <code>Cursor</code> object should be read. * If there are no ready bytes then this method should return. * * @param cursor used to consume the bytes from the HTTP pipeline */ public void consume(Cursor cursor) throws IOException { Counter counter = new Counter(cursor); while(counter.isReady()) { if(consumer.isFinished()) { break; } consumer.consume(counter); } }
/** * This method is used to consume bytes from the provided cursor. * Consuming of bytes from the cursor should be done in such a * way that it does not block. So typically only the number of * ready bytes in the <code>ByteCursor</code> object should be * read. If there are no ready bytes then this will return. * * @param cursor used to consume the bytes from the HTTP pipeline */ public void consume(ByteCursor cursor) throws IOException { ByteCounter counter = new ByteCounter(cursor); while(counter.isReady()) { if(consumer.isFinished()) { break; } consumer.consume(counter); } }
body.consume(cursor);
body.consume(cursor);
body.consume(cursor);