/** * This method is used to create the consumer given the list and * boundary for the part. In order to determine the part type * this will consult the header consumed for the part. Depending * on whether it is a list or body a suitable consumer is created. * * @param series this is the list used to collect the parts * @param boundary this is the boundary used to terminate the part * * @return this will return the consumer for the part body */ public BodyConsumer getInstance(PartSeries series, byte[] boundary) { byte[] terminal = getBoundary(segment); if(isUpload(segment)) { return new PartSeriesConsumer(allocator, series, terminal, length); } return new PartBodyConsumer(allocator, segment, series, boundary); } }
/** * This method is used to create the consumer given the list and * boundary for the part. In order to determine the part type * this will consult the header consumed for the part. Depending * on whether it is a list or body a suitable consumer is created. * * @param series this is the list used to collect the parts * @param boundary this is the boundary used to terminate the part * * @return this will return the consumer for the part body */ public BodyConsumer getInstance(PartSeries series, byte[] boundary) { byte[] terminal = getBoundary(segment); if(isUpload(segment)) { return new PartSeriesConsumer(allocator, series, terminal, length); } return new PartBodyConsumer(allocator, segment, series, boundary); } }
/** * This method is used to create the consumer given the list and * boundary for the part. In order to determine the part type * this will consult the header consumed for the part. Depending * on whether it is a list or body a suitable consumer is created. * * @param series this is the list used to collect the parts * @param boundary this is the boundary used to terminate the part * * @return this will return the consumer for the part body */ public BodyConsumer getInstance(PartSeries series, byte[] boundary) { byte[] terminal = getBoundary(segment); if(isUpload(segment)) { return new PartSeriesConsumer(allocator, series, terminal, length); } return new PartBodyConsumer(allocator, segment, series, boundary); } }