public class ByteArrayBlob extends AbstractBlob implements Serializable
TEXT_PLAIN, UTF_8| Constructor and Description |
|---|
ByteArrayBlob(byte[] bytes) |
ByteArrayBlob(byte[] bytes,
String mimeType) |
ByteArrayBlob(byte[] bytes,
String mimeType,
String encoding) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getByteArray() |
long |
getLength()
Gets the data length in bytes if known.
|
InputStream |
getStream()
Gets an
InputStream for the data of this blob. |
String |
getString() |
equals, getCloseableFile, getCloseableFile, getDigest, getEncoding, getFile, getFilename, getMimeType, hashCode, setDigest, setEncoding, setFilename, setMimeType, transferTo, transferTopublic ByteArrayBlob(byte[] bytes)
public ByteArrayBlob(byte[] bytes,
String mimeType)
public long getLength()
BlobgetLength in interface BlobgetLength in class AbstractBlobpublic InputStream getStream()
BlobInputStream for the data of this blob.
The contract of Blob is that this method can be called several times and will correctly return a new
InputStream each time. In other words, several reads of the Blob can be done.
Like all InputStream, the result must be closed when done with it to avoid resource leaks.
public byte[] getByteArray()
getByteArray in interface BlobgetByteArray in class AbstractBlobpublic String getString() throws IOException
getString in interface BlobgetString in class AbstractBlobIOExceptionCopyright © 2015 Nuxeo SA. All rights reserved.