public abstract class LobCopyInput extends java.lang.Object implements LobCopyParameter
Modifier and Type | Field and Description |
---|---|
private NumberType |
length
Number of bytes or characters to read; zero means all
|
(package private) NumberType |
offset
Offset (in bytes or characters) at which to start reading content for the copy
|
TYPE_BLOB, TYPE_CHAR_BIT, TYPE_CLOB, TYPE_FIELD_BIT, TYPE_FILE, TYPE_LONGCHAR, TYPE_MEMPTR, TYPE_UNKNOWN
Constructor and Description |
---|
LobCopyInput() |
Modifier and Type | Method and Description |
---|---|
protected int |
getLength()
Get the length of data to read (in bytes or characters) from the source content.
|
protected int |
getOffset()
Get the starting offset (in bytes or characters) for the source content.
|
protected abstract int |
getSize()
Get the size of the object to be copied.
|
LobCopyInput |
length(int length)
Set the length of the content to read; corresponds with the FOR option.
|
LobCopyInput |
length(NumberType length)
Set the length of the content to read; corresponds with the FOR option.
|
LobCopyInput |
offset(int offset)
Set the starting offset at which to read content; corresponds with the STARTING AT option.
|
LobCopyInput |
offset(NumberType offset)
Set the starting offset at which to read content; corresponds with the STARTING AT option.
|
protected abstract 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 abstract java.lang.String |
readString(java.lang.String charsetName)
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 |
validate(int targetType)
Validate this parameter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCodePage, getObjectType, isCharacterData, isLargeObject, validateOffset
NumberType offset
private NumberType length
public LobCopyInput offset(NumberType offset)
offset
- Starting offset.public LobCopyInput offset(int offset)
offset
- Starting offset.public LobCopyInput length(NumberType length)
length
- Length of content to read.public LobCopyInput length(int length)
length
- Length of content to read.public boolean validate(int targetType)
validate
in interface LobCopyParameter
targetType
- The type of the target object. The error messages are different in some cases.true
if validation did not encounter any issue and false
otherwise, when in
NO-ERROR mode and the ErrorConditionException
is not thrown.ErrorConditionException
- if the parameter fails validation and silent error mode is not active.protected int getOffset()
protected int getLength()
null
(i.e., the original statement had no
FOR option, the size of the source data is returned).protected abstract int getSize()
protected abstract java.lang.String readString(java.lang.String charsetName)
charsetName
- Name of the character set to be used to encode the read string. If null
,
the default charset will be used.protected abstract 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.