本文整理匯總了Java中org.simpleframework.util.buffer.BufferAllocator類的典型用法代碼示例。如果您正苦於以下問題:Java BufferAllocator類的具體用法?Java BufferAllocator怎麽用?Java BufferAllocator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BufferAllocator類屬於org.simpleframework.util.buffer包,在下文中一共展示了BufferAllocator類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: PartSeriesConsumer
import org.simpleframework.util.buffer.BufferAllocator; //導入依賴的package包/類
/**
* Constructor for the <code>PartSeriesConsumer</code> object. This
* will create a consumer that is capable of breaking an upload in
* to individual parts so that they can be accessed and used by
* the receiver of the HTTP request message.
*
* @param allocator this is used to allocate the internal buffer
* @param series this is the part list used to accumulate the parts
* @param boundary this is the boundary used for the upload
* @param length this is the number of bytes the upload should be
*/
public PartSeriesConsumer(Allocator allocator, PartSeries series, byte[] boundary, long length) {
this.buffer = new BufferAllocator(allocator, length);
this.consumer = new PartEntryConsumer(buffer, series, boundary, length);
this.factory = new PartEntryFactory(buffer, series, boundary, length);
this.series = series;
}
示例2: PartSeriesConsumer
import org.simpleframework.util.buffer.BufferAllocator; //導入依賴的package包/類
/**
* Constructor for the <code>PartListConsumer</code> object. This will
* create a consumer that is capable of breaking an upload in to individual
* parts so that they can be accessed and used by the receiver of the HTTP
* request message.
*
* @param allocator
* this is used to allocate the internal buffer
* @param series
* this is the part list used to accumulate the parts
* @param boundary
* this is the boundary used for the upload
* @param length
* this is the number of bytes the upload should be
*/
public PartSeriesConsumer(Allocator allocator, PartSeries series,
byte[] boundary, long length) {
this.buffer = new BufferAllocator(allocator, length);
this.consumer = new PartEntryConsumer(this.buffer, series, boundary);
this.factory = new PartEntryFactory(this.buffer, series, boundary);
this.series = series;
}