/** * 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); } }
/** * 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); } }