Package de.xima.fc.mdl
Class LargeString
java.lang.Object
de.xima.fc.mdl.LargeString
- All Implemented Interfaces:
Serializable
Wrapper for reading a string lazily, e.g. from a file.
- Since:
- 7.2.1
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLargeString
(ISerializableSupplier<String> supplier) A new large string that reads the data from the given supplier. -
Method Summary
Modifier and TypeMethodDescriptionstatic LargeString
empty()
boolean
getData()
int
hashCode()
static LargeString
ofByteArray
(byte[] data, Charset charset) static LargeString
static LargeString
ofFileAsBase64String
(File file) static LargeString
ofFileAsDataUri
(String mimeType, File file) static LargeString
toString()
-
Constructor Details
-
LargeString
A new large string that reads the data from the given supplier.- Parameters:
supplier
- Supplier for accessing the data when necessary.
-
-
Method Details
-
equals
-
getData
- Returns:
- The data encapsulated by this large string instance.
-
hashCode
public int hashCode() -
toString
-
empty
- Returns:
- A large string with no data.
-
ofByteArray
- Parameters:
data
- Binary data.charset
- Charset to use.- Returns:
- A large string with the given data.
-
ofFile
- Parameters:
file
- File with the data.charset
- Charset to use for reading the data.- Returns:
- A large string with the data of the given file.
-
ofFileAsBase64String
- Parameters:
file
- File with the data.- Returns:
- A large string with the data of the given file as a base 64 string.
-
ofFileAsDataUri
- Parameters:
mimeType
- Mime type of the file.file
- File with the data.- Returns:
- A large string with the data of the given file as a data URI.
-
ofValue
- Parameters:
value
- Value to wrap.- Returns:
- A large string with the given data.
-