/** * This is used to determine whether the part body has been read * from the cursor successfully. In order to determine if all of * the bytes have been read successfully this will check to see * of the terminal token had been consumed. * * @return true if the part body and terminal have been read */ public boolean isFinished() { if(body != null) { return body.isFinished(); } return false; } }
/** * This is used to determine whether the part body has been read * from the cursor successfully. In order to determine if all of * the bytes have been read successfully this will check to see * of the terminal token had been consumed. * * @return true if the part body and terminal have been read */ public boolean isFinished() { if(body != null) { return body.isFinished(); } return false; } }
/** * This is used to determine whether the part body has been read * from the cursor successfully. In order to determine if all of * the bytes have been read successfully this will check to see * of the terminal token had been consumed. * * @return true if the part body and terminal have been read */ public boolean isFinished() { if(body != null) { return body.isFinished(); } return false; } }
/** * This is used to determine whether the consumer has finished * reading. The consumer is considered finished if it has read a * terminal token or if it has exhausted the stream and can not * read any more. Once finished the consumed bytes can be parsed. * * @return true if the consumer has finished reading its content */ public boolean isFinished() { long remaining = count.get(); if(consumer.isFinished()) { return true; } return remaining <= 0; }
/** * This is used to determine whether the consumer has finished * reading. The consumer is considered finished if it has read a * terminal token or if it has exhausted the stream and can not * read any more. Once finished the consumed bytes can be parsed. * * @return true if the consumer has finished reading its content */ public boolean isFinished() { long remaining = count.get(); if(consumer.isFinished()) { return true; } return remaining <= 0; }
/** * This is used to determine whether the consumer has finished * reading. The consumer is considered finished if it has read a * terminal token or if it has exhausted the stream and can not * read any more. Once finished the consumed bytes can be parsed. * * @return true if the consumer has finished reading its content */ public boolean isFinished() { long remaining = count.get(); if(consumer.isFinished()) { return true; } return remaining <= 0; }
/** * 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); } }
/** * This is determined finished when the body has been consumed. * If only the header has been consumed then the body will be * created using the header information, the body is then read * from the cursor, which may read nothing for an empty body. * * @return this returns true if the entity has been built */ public boolean isFinished() { if(header.isFinished()) { if(body == null) { CharSequence sequence = header.getHeader(); trace.trace(HEADER_FINISHED, sequence); body = factory.getInstance(); } return body.isFinished(); } return false; }
/** * This is determined finished when the body has been consumed. * If only the header has been consumed then the body will be * created using the header information, the body is then read * from the cursor, which may read nothing for an empty body. * * @return this returns true if the entity has been built */ public boolean isFinished() { if(header.isFinished()) { if(body == null) { CharSequence sequence = header.getHeader(); trace.trace(HEADER_FINISHED, sequence); body = factory.getInstance(); } return body.isFinished(); } return false; }
/** * This is determined finished when the body has been consumed. * If only the header has been consumed then the body will be * created using the header information, the body is then read * from the cursor, which may read nothing for an empty body. * * @return this returns true if the entity has been built */ public boolean isFinished() { if(header.isFinished()) { if(body == null) { CharSequence sequence = header.getHeader(); trace.trace(HEADER_FINISHED, sequence); body = factory.getInstance(); } return body.isFinished(); } return false; }
/** * This is used to consume the part body from the cursor. This * initially reads the body of the part, which represents the * actual payload exposed via the <code>Part</code> interface * once the payload has been consumed the terminal is consumed. * * @param cursor this is the cursor to consume the body from */ public void consume(ByteCursor cursor) throws IOException { while(cursor.isReady()) { if(header.isFinished()) { if(body == null) { body = getConsumer(); current = body; } else { if(body.isFinished()) break; } } current.consume(cursor); } }
/** * This is used to consume the part body from the cursor. This * initially reads the body of the part, which represents the * actual payload exposed via the <code>Part</code> interface * once the payload has been consumed the terminal is consumed. * * @param cursor this is the cursor to consume the body from */ public void consume(ByteCursor cursor) throws IOException { while(cursor.isReady()) { if(header.isFinished()) { if(body == null) { body = getConsumer(); current = body; } else { if(body.isFinished()) break; } } current.consume(cursor); } }
/** * This is used to consume the part body from the cursor. This * initially reads the body of the part, which represents the * actual payload exposed via the <code>Part</code> interface * once the payload has been consumed the terminal is consumed. * * @param cursor this is the cursor to consume the body from */ public void consume(Cursor cursor) throws IOException { while(cursor.isReady()) { if(header.isFinished()) { if(body == null) { body = getConsumer(); current = body; } else { if(body.isFinished()) break; } } current.consume(cursor); } }
body.consume(cursor); if(body.isFinished()) { trace.trace(BODY_FINISHED); break;
body.consume(cursor); if(body.isFinished()) { trace.trace(BODY_FINISHED); break;
body.consume(cursor); if(body.isFinished()) { trace.trace(BODY_FINISHED); break;