Package org.rapidcontext.core.data
Class Binary.BinaryString
java.lang.Object
org.rapidcontext.core.data.Binary.BinaryString
- All Implemented Interfaces:
Binary
- Enclosing interface:
Binary
A binary data object, encapsulating a string.
- Version:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.rapidcontext.core.data.Binary
Binary.BinaryFile, Binary.BinaryStream, Binary.BinaryString
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
The last modified timestamp for the object, if known.mimeType()
The MIME type of the binary data.Opens a new input stream for reading the data.sha256()
The SHA-256 of the binary data, if known.long
size()
Returns the size (in bytes) of the binary object, if known.
-
Constructor Details
-
BinaryString
Creates a new binary string wrapper.- Parameters:
data
- the string to encapsulate
-
-
Method Details
-
size
public long size()Returns the size (in bytes) of the binary object, if known. -
lastModified
public long lastModified()The last modified timestamp for the object, if known.- Specified by:
lastModified
in interfaceBinary
- Returns:
- the last modified timestamp, or zero (0) or the current system if unknown
-
mimeType
The MIME type of the binary data. Use a standard opaque binary data MIME type or one based on requested file name if unknown. -
sha256
The SHA-256 of the binary data, if known. -
openStream
Opens a new input stream for reading the data. Note that this method SHOULD be possible to call several times.- Specified by:
openStream
in interfaceBinary
- Returns:
- a new input stream for reading the binary data
- Throws:
IOException
- if the data couldn't be opened for reading
-