public class DBBlobData extends Object
| Constructor and Description |
|---|
DBBlobData(byte[] data)
Constructor for LobData from a byte array.
|
DBBlobData(InputStream inputStream,
int length)
Constructor to pass LOB data to the setValue methods
of a record, consisting of the input stream where
the data can be loaded from and the length of the data.
|
DBBlobData(String text)
Constructor for LobData from a string.
|
DBBlobData(String text,
String encoding)
Constructor for LobData from a string.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getInputStream()
Returns the inputStream with the binary data for the BLOB.
|
int |
getLength()
Returns the length of the BLOB data in bytes.
|
static void |
setDefaultEncoding(String defaultEncoding)
Sets the defaultEncoding used in a constructor.
|
public DBBlobData(InputStream inputStream, int length) throws IllegalArgumentException
inputStream - The stream where the data will be read fromlength - The number of bytes to read from the streamIllegalArgumentException - If the inputStream is nullpublic DBBlobData(byte[] data)
throws IllegalArgumentException
data - The byte arrayIllegalArgumentException - If the text is null or the encoding is unsupportedString.getBytes(java.lang.String)public DBBlobData(String text, String encoding) throws IllegalArgumentException
text - The string to be used as dataencoding - The encoding of the string. The string must be converted to a byte array to put in the BLOB. It is
necessary to convert the string.IllegalArgumentException - If the text is null or the encoding is unsupportedString.getBytes(java.lang.String)public DBBlobData(String text) throws IllegalArgumentException
text - The string to be used as data. The encoding is set using setDefaultEncodingIllegalArgumentException - If the text is null or the encoding is unsupportedString.getBytes(java.lang.String)public InputStream getInputStream()
public int getLength()
public static void setDefaultEncoding(String defaultEncoding)
defaultEncoding - Set the defaultEncoding used in a constructorDBBlobData(String)Copyright © 2008–2023 Apache Software Foundation. All rights reserved.