Package org.nuxeo.ecm.core.api.impl.blob
Class StringBlob
java.lang.Object
org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
org.nuxeo.ecm.core.api.impl.blob.StringBlob
- All Implemented Interfaces:
Serializable,Blob
- Direct Known Subclasses:
JSONBlob
Blob based on a string.
- See Also:
-
Field Summary
FieldsFields inherited from class org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
digest, digestAlgorithm, encoding, filename, mimeType, TEXT_PLAIN, UTF_8 -
Constructor Summary
ConstructorsConstructorDescriptionStringBlob(String content) StringBlob(String string, String mimeType) StringBlob(String string, String mimeType, String encoding) StringBlob(String string, String mimeType, String encoding, String filename) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]longGets the data length in bytes if known.Gets anInputStreamfor the data of this blob.Methods inherited from class org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
equals, equalsStream, getCloseableFile, getCloseableFile, getDigest, getDigestAlgorithm, getEncoding, getFile, getFilename, getMimeType, hashCode, setDigest, setDigestAlgorithm, setEncoding, setFilename, setMimeType, transferTo, transferTo
-
Field Details
-
string
-
-
Constructor Details
-
StringBlob
-
StringBlob
-
StringBlob
-
StringBlob
-
-
Method Details
-
getLength
public long getLength()Description copied from interface:BlobGets the data length in bytes if known.- Specified by:
getLengthin interfaceBlob- Overrides:
getLengthin classAbstractBlob- Returns:
- the data length or -1 if not known
-
getStream
Description copied from interface:BlobGets anInputStreamfor the data of this blob.The contract of
Blobis that this method can be called several times and will correctly return a newInputStreameach time. In other words, several reads of theBlobcan be done.Like all
InputStream, the result must be closed when done with it to avoid resource leaks.- Specified by:
getStreamin interfaceBlob- Returns:
- the stream
- Throws:
IOException
-
getByteArray
- Specified by:
getByteArrayin interfaceBlob- Overrides:
getByteArrayin classAbstractBlob- Throws:
IOException
-
getString
- Specified by:
getStringin interfaceBlob- Overrides:
getStringin classAbstractBlob
-