/** * 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>Attachment</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 content.getBody(); }
/** * 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(content.isFinished()) { if(token.isFinished()) { break; } token.consume(cursor); } else { content.consume(cursor); } } }
if(array[off++] != boundary[seek++]) { // boundary not found if(skip > 0) { append(START, 0, next); // write skipped start append(boundary, 0, skip - next); // write skipped boundary append(array, mark, valid); Part part = getPart(); append(START, 0, next); // write skipped start append(array, mark, valid);
/** * Constructor for the <code>PartBodyConsumer</code> object. This * is used to create a consumer that reads the body of a part in * a multipart request body. The terminal token must be provided * so that the end of the part body can be determined. * * @param allocator this is used to allocate the internal buffer * @param segment this represents the headers for the part body * @param series this is the part list that this body belongs in * @param boundary this is the message boundary for the body part */ public PartBodyConsumer(Allocator allocator, Segment segment, PartSeries series, byte[] boundary) { this.content = new ContentConsumer(allocator, segment, series, boundary); this.token = new TokenConsumer(allocator, LINE); }
/** * 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(content.isFinished()) { if(token.isFinished()) { break; } token.consume(cursor); } else { content.consume(cursor); } } }
if(array[off++] != boundary[seek++]) { // boundary not found if(skip > 0) { append(START, 0, next); // write skipped start append(boundary, 0, skip - next); // write skipped boundary append(array, mark, valid); Part part = getPart(); append(START, 0, next); // write skipped start append(array, mark, valid);
/** * Constructor for the <code>PartBodyConsumer</code> object. This * is used to create a consumer that reads the body of a part in * a multipart request body. The terminal token must be provided * so that the end of the part body can be determined. * * @param allocator this is used to allocate the internal buffer * @param segment this represents the headers for the part body * @param series this is the part list that this body belongs in * @param boundary this is the message boundary for the body part */ public PartBodyConsumer(Allocator allocator, Segment segment, PartSeries series, byte[] boundary) { this.content = new ContentConsumer(allocator, segment, series, boundary); this.token = new TokenConsumer(allocator, LINE); }
/** * 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(content.isFinished()) { if(token.isFinished()) { break; } token.consume(cursor); } else { content.consume(cursor); } } }
if(array[off++] != boundary[seek++]) { // boundary not found if(skip > 0) { append(START, 0, next); // write skipped start append(boundary, 0, skip - next); // write skipped boundary append(array, mark, valid); Part part = getPart(); append(START, 0, next); // write skipped start append(array, mark, valid);
/** * 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>Attachment</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 content.getBody(); }
/** * Constructor for the <code>PartBodyConsumer</code> object. This * is used to create a consumer that reads the body of a part in * a multipart request body. The terminal token must be provided * so that the end of the part body can be determined. * * @param allocator this is used to allocate the internal buffer * @param segment this represents the headers for the part body * @param series this is the part list that this body belongs in * @param boundary this is the message boundary for the body part */ public PartBodyConsumer(Allocator allocator, Segment segment, PartSeries series, byte[] boundary) { this.content = new ContentConsumer(allocator, segment, series, boundary); this.token = new TokenConsumer(allocator, LINE); }
/** * 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>Attachment</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 content.getBody(); }