org.apache.jackrabbit.mk.blobs
Interface BlobStore

All Known Implementing Classes:
AbstractBlobStore, DbBlobStore, FileBlobStore, MemoryBlobStore

public interface BlobStore

An interface to store and read large binary objects.


Method Summary
 long getBlobLength(String blobId)
          Get the length of the blob.
 int readBlob(String blobId, long pos, byte[] buff, int off, int length)
          Read a number of bytes from a blob.
 String writeBlob(InputStream in)
          Write a blob from an input stream.
 

Method Detail

writeBlob

String writeBlob(InputStream in)
                 throws Exception
Write a blob from an input stream. This method closes the input stream.

Parameters:
in - the input stream
Returns:
the blob id
Throws:
Exception

readBlob

int readBlob(String blobId,
             long pos,
             byte[] buff,
             int off,
             int length)
             throws Exception
Read a number of bytes from a blob.

Parameters:
blobId - the blob id
pos - the position within the blob
buff - the target byte array
off - the offset within the target array
length - the number of bytes to read
Returns:
the number of bytes read
Throws:
Exception

getBlobLength

long getBlobLength(String blobId)
                   throws Exception
Get the length of the blob.

Parameters:
blobId - the blob id
Returns:
the length
Throws:
Exception


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.