public class LoopbackBlobStore extends java.lang.Object implements BlobStore
blobId = e7c22b994c59d9
it will return the
e7c22b994c59d9
text as a UTF-8 encoded binary file.Constructor and Description |
---|
LoopbackBlobStore() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.lang.String |
getBlobId(@NotNull java.lang.String reference)
Returns the blobId that referred by the given binary reference.
|
long |
getBlobLength(java.lang.String blobId)
Get the length of the blob.
|
java.io.InputStream |
getInputStream(java.lang.String blobId)
Returns a new stream for given blobId.
|
java.lang.String |
getReference(@NotNull java.lang.String blobId)
Returns a secure reference to blob referred by blobid, or
null if no such
reference is available. |
int |
readBlob(java.lang.String blobId,
long pos,
byte[] buff,
int off,
int length)
Read a number of bytes from a blob.
|
java.lang.String |
writeBlob(java.io.InputStream in)
Write a blob from an input stream.
|
java.lang.String |
writeBlob(java.io.InputStream in,
BlobOptions options)
Write a blob from an input stream with specified options.
|
public java.lang.String writeBlob(java.io.InputStream in)
BlobStore
public java.lang.String writeBlob(java.io.InputStream in, BlobOptions options) throws java.io.IOException
BlobStore
public int readBlob(java.lang.String blobId, long pos, byte[] buff, int off, int length)
BlobStore
public long getBlobLength(java.lang.String blobId) throws java.io.IOException
BlobStore
getBlobLength
in interface BlobStore
blobId
- the blob idjava.io.IOException
public java.io.InputStream getInputStream(java.lang.String blobId) throws java.io.IOException
BlobStore
read
return the same sequence of bytes as long as neither call throws
an exception.getInputStream
in interface BlobStore
blobId
- the blob idjava.io.IOException
public java.lang.String getBlobId(@NotNull @NotNull java.lang.String reference)
BlobStore
null
if the reference is invalid, for example if it
points to a blob that does not exist.public java.lang.String getReference(@NotNull @NotNull java.lang.String blobId)
BlobStore
null
if no such
reference is available.getReference
in interface BlobStore
blobId
- blobId referring the blob for which reference is requirednull
public void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception
Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.