public class ThresholdStorageProvider extends AbstractStorageProvider
StorageProviderthat keeps small amounts of data in memory and writes the remainder to another
StorageProvider(the back-end) if a certain threshold size gets exceeded.
StorageProvider tempStore = new TempFileStorageProvider(); StorageProvider provider = new ThresholdStorageProvider(tempStore, 4096); DefaultStorageProvider.setInstance(provider);
|Constructor and Description|
Creates a new
Creates a new
|Modifier and Type||Method and Description|
public ThresholdStorageProvider(StorageProvider backend)
ThresholdStorageProviderfor the given back-end using a threshold size of 2048 bytes.
public ThresholdStorageProvider(StorageProvider backend, int thresholdSize)
ThresholdStorageProviderfor the given back-end and threshold size.
backend- used to store the remainder of the data if the threshold size gets exceeded.
thresholdSize- determines how much bytes are kept in memory before that back-end storage provider is used to store the remainder of the data.
public StorageOutputStream createStorageOutputStream()
StorageOutputStreamwhere data to be stored can be written to. Subsequently the user can call
toStorage()on that object to get a
Storageinstance that holds the data that has been written.
StorageOutputStreamwhere data can be written to.
Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.