public class SourceLob extends LobCopyInput
FROM [ OBJECT ] source-lob
phrase.Modifier and Type | Field and Description |
---|---|
private LargeObject |
lob
Large object which is the source of the copy operation
|
offset
TYPE_BLOB, TYPE_CHAR_BIT, TYPE_CLOB, TYPE_FIELD_BIT, TYPE_FILE, TYPE_LONGCHAR, TYPE_MEMPTR, TYPE_UNKNOWN
Constructor and Description |
---|
SourceLob(LargeObject lob)
Constructor which takes a LOB.
|
SourceLob(java.lang.Object lob)
Constructor which takes an object that is expected to be a LOB.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCodePage()
Get the code page of this parameter, if any.
|
int |
getObjectType()
Obtain the type of the object wrapped by this parameter
|
protected int |
getSize()
Get the size of the object to be copied.
|
boolean |
isCharacterData()
Indicate whether the large object represented by this parameter natively represents
encoded character data, as opposed to binary data.
|
boolean |
isLargeObject()
Indicate whether this object is a valid large object data type.
|
protected byte[] |
readBytes()
Read the content of the backing LOB from the starting offset up to the length and return
it as a byte buffer.
|
protected java.lang.String |
readString(java.lang.String codePage)
Read the content of the backing LOB from the starting offset up to the length and return
it as a string using the given encoding.
|
boolean |
validateOffset(int targetType)
Checks if the optional offset is valid.
|
private final LargeObject lob
public SourceLob(LargeObject lob)
lob
- Large object which is the source of the copy operation.public SourceLob(java.lang.Object lob)
lob
- Large object which is the source of the copy operation.ConditionException
- if lob
is not an instance of @LargeObject@.public boolean validateOffset(int targetType)
targetType
- The type of the target object. The error messages are different in some cases.true
if the optional offset is valid.public boolean isLargeObject()
true
if valid, else false
. The default implementation assumes
validity; implementors which must handle runtime type verification must override
this method.public int getObjectType()
LobCopyParameter
interface.public boolean isCharacterData()
true
if character data; false
if binary data.protected int getSize()
getSize
in class LobCopyInput
public java.lang.String getCodePage()
null
if parameter represents non-character data.protected java.lang.String readString(java.lang.String codePage)
readString
in class LobCopyInput
codePage
- Name of the 4GL code page to be used to encode the read string. If null
,
the large object's explicit code page (if any) will be used. If none, the value
of -cpinternal
will be used.protected byte[] readBytes()
Note that the returned buffer must not be modified, as it could either be a copy of the LOB's data or its real backing data.
readBytes
in class LobCopyInput