Package org.apache.axiom.blob
Class Blobs
- java.lang.Object
-
- org.apache.axiom.blob.Blobs
-
public final class Blobs extends Object
Contains factory methods to create various types of blobs.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BlobcreateBlob(byte[] data)Create a blob from a byte array.static MemoryBlobcreateMemoryBlob()Create aMemoryBlobinstance.static OverflowableBlobcreateOverflowableBlob(int threshold, String tempPrefix, String tempSuffix, File tempDirectory)Create anOverflowableBlobthat overflows to a temporary file.static OverflowableBlobcreateOverflowableBlob(int threshold, WritableBlobFactory<?> overflowBlobFactory)Create anOverflowableBlob.
-
-
-
Method Detail
-
createBlob
public static Blob createBlob(byte[] data)
Create a blob from a byte array.- Parameters:
data- the byte array- Returns:
- the blob
-
createMemoryBlob
public static MemoryBlob createMemoryBlob()
Create aMemoryBlobinstance.- Returns:
- the blob
-
createOverflowableBlob
public static OverflowableBlob createOverflowableBlob(int threshold, WritableBlobFactory<?> overflowBlobFactory)
Create anOverflowableBlob.- Parameters:
threshold- the threshold above which data is transferred to the overflow bloboverflowBlobFactory- the factory that will be used to create the overflow blob- Returns:
- the blob
-
createOverflowableBlob
public static OverflowableBlob createOverflowableBlob(int threshold, String tempPrefix, String tempSuffix, File tempDirectory)
Create anOverflowableBlobthat overflows to a temporary file. Temporary files are created usingFile.createTempFile(String, String, File).- Parameters:
threshold- the overflow thresholdtempPrefix- the prefix to be used in generating the name of the temporary filetempSuffix- the suffix to be used in generating the name of the temporary filetempDirectory- the directory in which the temporary file is to be created, ornullif the default temporary directory is to be used- Returns:
- the blob
-
-