Interface BlobStore
- 
- All Superinterfaces:
 java.lang.AutoCloseable
- All Known Subinterfaces:
 BlobStoreWrapper,GarbageCollectableBlobStore,SplitBlobStore
- All Known Implementing Classes:
 AbstractBlobStore,CachingBlobStore,DataStoreBlobStore,DefaultSplitBlobStore,FileBlobStore,MemoryBlobStore,WrappingSplitBlobStore
public interface BlobStore extends java.lang.AutoCloseableAn interface to store and read large binary objects. 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @Nullable java.lang.StringgetBlobId(@NotNull java.lang.String reference)Returns the blobId that referred by the given binary reference.longgetBlobLength(java.lang.String blobId)Get the length of the blob.java.io.InputStreamgetInputStream(java.lang.String blobId)Returns a new stream for given blobId.@Nullable java.lang.StringgetReference(@NotNull java.lang.String blobId)Returns a secure reference to blob referred by blobid, ornullif no such reference is available.intreadBlob(java.lang.String blobId, long pos, byte[] buff, int off, int length)Read a number of bytes from a blob.java.lang.StringwriteBlob(java.io.InputStream in)Write a blob from an input stream.java.lang.StringwriteBlob(java.io.InputStream in, BlobOptions options)Write a blob from an input stream with specified options. 
 - 
 
- 
- 
Method Detail
- 
writeBlob
java.lang.String writeBlob(java.io.InputStream in) throws java.io.IOExceptionWrite a blob from an input stream. This method closes the input stream.- Parameters:
 in- the input stream- Returns:
 - the blob id
 - Throws:
 java.io.IOException
 
- 
writeBlob
java.lang.String writeBlob(java.io.InputStream in, BlobOptions options) throws java.io.IOExceptionWrite a blob from an input stream with specified options. This method closes the input stream.- Parameters:
 in- the input stream to writeoptions- the options to use- Returns:
 - Throws:
 java.io.IOException
 
- 
readBlob
int readBlob(java.lang.String blobId, long pos, byte[] buff, int off, int length) throws java.io.IOExceptionRead a number of bytes from a blob.- Parameters:
 blobId- the blob idpos- the position within the blobbuff- the target byte arrayoff- the offset within the target arraylength- the number of bytes to read- Returns:
 - the number of bytes read
 - Throws:
 java.io.IOException
 
- 
getBlobLength
long getBlobLength(java.lang.String blobId) throws java.io.IOExceptionGet the length of the blob.- Parameters:
 blobId- the blob id- Returns:
 - the length
 - Throws:
 java.io.IOException
 
- 
getInputStream
java.io.InputStream getInputStream(java.lang.String blobId) throws java.io.IOExceptionReturns a new stream for given blobId. The streams returned from multiple calls to this method are byte wise equals. That is, subsequent calls toreadreturn the same sequence of bytes as long as neither call throws an exception.- Parameters:
 blobId- the blob id- Returns:
 - a new stream for given blobId
 - Throws:
 java.io.IOException
 
- 
getBlobId
@Nullable @Nullable java.lang.String getBlobId(@NotNull @NotNull java.lang.String reference)Returns the blobId that referred by the given binary reference. Returnsnullif the reference is invalid, for example if it points to a blob that does not exist.- Parameters:
 reference- binary reference- Returns:
 - matching blobId, or 
null 
 
- 
getReference
@Nullable @Nullable java.lang.String getReference(@NotNull @NotNull java.lang.String blobId)Returns a secure reference to blob referred by blobid, ornullif no such reference is available.- Parameters:
 blobId- blobId referring the blob for which reference is required- Returns:
 - binary reference, or 
null 
 
 - 
 
 -