public final class Blob extends Object
Constructor and Description |
---|
Blob(String contentType,
byte[] content)
Construct a Blob with the given in-memory data.
|
Blob(String contentType,
InputStream stream)
Construct a Blob with the given stream of data The blob can then be added as a property of
a Document.
|
Blob(String contentType,
URL fileURL)
Construct a Blob with the content of a file.
|
Modifier and Type | Method and Description |
---|---|
String |
digest()
The cryptograhic digest of this Blob's contents, which uniquely identifies it.
|
void |
encodeTo(FLEncoder encoder) |
boolean |
equals(Object o) |
byte[] |
getContent()
Gets the contents of a Blob as a block of memory.
|
InputStream |
getContentStream()
Get the stream of content of a Blob.
|
String |
getContentType()
Return the type of content this Blob represents; by convention this is a MIME type.
|
Map<String,Object> |
getProperties()
Return the metadata associated with this Blob
|
int |
hashCode() |
long |
length()
The binary length of this Blob
|
String |
toString()
Returns a string representation of the object.
|
public Blob(String contentType, byte[] content)
contentType
- The type of content this Blob will representcontent
- The data that this Blob will containpublic Blob(String contentType, InputStream stream)
contentType
- The type of content this Blob will representstream
- The stream of data that this Blob will consumepublic Blob(String contentType, URL fileURL) throws IOException
contentType
- The type of content this Blob will representfileURL
- A URL to a file containing the data that this Blob will represent.IOException
public byte[] getContent()
public InputStream getContentStream()
public String getContentType()
public long length()
public String digest()
public Map<String,Object> getProperties()
public String toString()
public void encodeTo(FLEncoder encoder)