public class ByteArrayBlob extends DefaultBlob implements Serializable
EMPTY_BYTE_ARRAY, EMPTY_INPUT_STREAM, EMPTY_READER, EMPTY_STRING
Constructor and Description |
---|
ByteArrayBlob(byte[] content) |
ByteArrayBlob(byte[] content,
String ctype) |
ByteArrayBlob(byte[] content,
String ctype,
String encoding) |
ByteArrayBlob(byte[] content,
String mimeType,
String encoding,
String filename,
String digest) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getByteArray() |
long |
getLength()
Gets the data length in bytes if known.
|
Reader |
getReader() |
InputStream |
getStream() |
String |
getString() |
boolean |
isPersistent()
Checks whether this blob is persistent.
|
Blob |
persist()
Persist this stream so that
Blob.getStream() method can be called
successfully several times. |
getDigest, getEncoding, getFilename, getMimeType, setDigest, setEncoding, setFilename, setMimeType
copy, copy, transferTo, transferTo, transferTo
public ByteArrayBlob(byte[] content)
public ByteArrayBlob(byte[] content, String ctype)
public long getLength()
Blob
public InputStream getStream() throws IOException
getStream
in interface Blob
IOException
public byte[] getByteArray() throws IOException
getByteArray
in interface Blob
IOException
public String getString() throws IOException
getString
in interface Blob
IOException
public Reader getReader() throws IOException
getReader
in interface Blob
IOException
public Blob persist() throws IOException
Blob
Blob.getStream()
method can be called
successfully several times. The persistence is done in a temporary file
or in memory - this is up to the implementation.
Blobs that are already persistent return themselves.
Persistence should update the internal structure of the Blob to make it persistent whenever possible and hence return itself whenever possible. This behavior cannot be guaranteed by every implementation however.
persist
in interface Blob
IOException
public boolean isPersistent()
Blob
Blob.getStream()
can be
successfully called several times).isPersistent
in interface Blob
Copyright © 2013 Nuxeo SA. All Rights Reserved.