/** * This is used to acquire the body that has been consumed. This * will return a body which can be used to read the content of * the message, also if the request is multipart upload then all * of the parts are provided as <code>Part</code> objects. * Each part can then be read as an individual message. * * @return the body that has been consumed by this instance */ public Body getBody() { return consumer.getBody(); }
/** * 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 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 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 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 acquire the body for this HTTP entity. This * will return a body which can be used to read the content of * the message, also if the request is multipart upload then all * of the parts are provided as <code>Attachment</code> objects. * Each part can then be read as an individual message. * * @return the body provided by the HTTP request message */ public Body getBody() { return body.getBody(); }
body.consume(cursor); if(body.isFinished()) { trace.trace(BODY_FINISHED); break;
/** * 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 acquire the body for this HTTP entity. This * will return a body which can be used to read the content of * the message, also if the request is multipart upload then all * of the parts are provided as <code>Attachment</code> objects. * Each part can then be read as an individual message. * * @return the body provided by the HTTP request message */ public Body getBody() { return body.getBody(); }
body.consume(cursor); if(body.isFinished()) { trace.trace(BODY_FINISHED); break;
/** * 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 acquire the body that has been consumed. This * will return a body which can be used to read the content of * the message, also if the request is multipart upload then all * of the parts are provided as <code>Part</code> objects. * Each part can then be read as an individual message. * * @return the body that has been consumed by this instance */ public Body getBody() { return consumer.getBody(); }
body.consume(cursor); if(body.isFinished()) { trace.trace(BODY_FINISHED); break;
/** * 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 acquire the body for this HTTP entity. This * will return a body which can be used to read the content of * the message, also if the request is multipart upload then all * of the parts are provided as <code>Attachment</code> objects. * Each part can then be read as an individual message. * * @return the body provided by the HTTP request message */ public Body getBody() { return body.getBody(); }
/** * 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 acquire the body that has been consumed. This * will return a body which can be used to read the content of * the message, also if the request is multipart upload then all * of the parts are provided as <code>Part</code> objects. * Each part can then be read as an individual message. * * @return the body that has been consumed by this instance */ public Body getBody() { return consumer.getBody(); }
/** * 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; }