/** * This method is used to create a body consumer to read the body * from the pipeline. This will examine the HTTP header associated * with the body to determine how to consume the data. This will * provide an empty consumer if no specific delimiter was provided. * * @param length this is the length of the body to be consumed * * @return this returns the consumer used to consume the body */ public BodyConsumer getInstance(long length) { byte[] boundary = getBoundary(segment); if(isUpload(segment)) { return new FileUploadConsumer(allocator, boundary, length); } if(isChunked(segment)) { return new ChunkedConsumer(allocator); } if(isFixed(segment)) { return new FixedLengthConsumer(allocator, length); } return new EmptyConsumer(); }
/** * This method is used to create a body consumer to read the body * from the pipeline. This will examine the HTTP header associated * with the body to determine how to consume the data. This will * provide an empty consumer if no specific delimiter was provided. * * @param length this is the length of the body to be consumed * * @return this returns the consumer used to consume the body */ public BodyConsumer getInstance(long length) { byte[] boundary = getBoundary(segment); if(isUpload(segment)) { return new FileUploadConsumer(allocator, boundary, length); } if(isChunked(segment)) { return new ChunkedConsumer(allocator); } if(isFixed(segment)) { return new FixedConsumer(allocator, length); } return new EmptyConsumer(); }
/** * This method is used to create a body consumer to read the body * from the pipeline. This will examine the HTTP header associated * with the body to determine how to consume the data. This will * provide an empty consumer if no specific delimiter was provided. * * @param length this is the length of the body to be consumed * * @return this returns the consumer used to consume the body */ public BodyConsumer getInstance(long length) { byte[] boundary = getBoundary(segment); if(isUpload(segment)) { return new FileUploadConsumer(allocator, boundary, length); } if(isChunked(segment)) { return new ChunkedConsumer(allocator); } if(isFixed(segment)) { return new FixedLengthConsumer(allocator, length); } return new EmptyConsumer(); }