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

  Modifier and Type
  Method
  Description
  `static Blob`
  `createBlob(byte[] data)`
  Create a blob from a byte array.
  `static MemoryBlob`
  `createMemoryBlob()`
  Create a `MemoryBlob` instance.
  `static OverflowableBlob`
  `createOverflowableBlob(int threshold, String tempPrefix, String tempSuffix, File tempDirectory)`
  Create an `OverflowableBlob` that overflows to a temporary file.
  `static OverflowableBlob`
  `createOverflowableBlob(int threshold, WritableBlobFactory<?> overflowBlobFactory)`
  Create an `OverflowableBlob`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### 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 a `MemoryBlob` instance.
    Returns:
      the blob

  - ### createOverflowableBlob

    public static OverflowableBlob createOverflowableBlob(int threshold, WritableBlobFactory<?> overflowBlobFactory)
    Create an `OverflowableBlob`.
    Parameters:
      `threshold` - the threshold above which data is transferred to the overflow blob
      `overflowBlobFactory` - 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 an `OverflowableBlob` that overflows to a temporary file. Temporary files are created using `File.createTempFile(String, String, File)`.
    Parameters:
      `threshold` - the overflow threshold
      `tempPrefix` - the prefix to be used in generating the name of the temporary file
      `tempSuffix` - the suffix to be used in generating the name of the temporary file
      `tempDirectory` - the directory in which the temporary file is to be created, or `null` if the default temporary directory is to be used
    Returns:
      the blob