Top Description Fields Constructors Methods
org.h2.value

public final Class ValueClob

extends ValueLob
Class Inheritance
Imports
java.io.BufferedReader, .IOException, .InputStream, .Reader, java.nio.charset.StandardCharsets, java.util.Arrays, org.h2.engine.CastDataProvider, .Constants, .SysProperties, org.h2.message.DbException, org.h2.store.DataHandler, .FileStore, .FileStoreOutputStream, .LobStorageInterface, .RangeReader, org.h2.util.IOUtils, .MathUtils, .StringUtils, org.h2.value.lob.LobData, .LobDataDatabase, .LobDataFetchOnDemand, .LobDataFile, .LobDataInMemory

Implementation of the CHARACTER LARGE OBJECT data type.

Field Summary

Inherited from org.h2.value.ValueLob:
BLOCK_COMPARISON_SIZEcharLengthlobDataoctetLength

Constructor Summary

AccessConstructor and Description
public
ValueClob(LobData lobData, long octetLength, long charLength)

Method Summary

Modifier and TypeMethod and Description
public long
charLength()

Overrides org.h2.value.Value.charLength.

Returns length of this value in characters.

private static int

Returns:

result of comparison
compare
(ValueClob
first CLOB value
v1
,
ValueClob
second CLOB value
v2
)

Compares two CLOB values directly.

public int
compareTypeSafe(Value
the other value
v
,
CompareMode
the compare mode
mode
,
CastDataProvider
the cast information provider
provider
)

Implements abstract org.h2.value.Value.compareTypeSafe.

Compare this value against another value given that the values are of the same data type.

pack-priv ValueClob

Returns:

the truncated or this value
convertPrecision
(long
the new precision
precision
)

Convert the precision to the requested value.

public ValueLob
copy(DataHandler
the data handler
database
,
int
the table where this object is used
tableId
)

Implements abstract org.h2.value.ValueLob.copy.

Copy a large value, to be used in the given table.

public static ValueClob

Returns:

the CLOB
createSmall
(byte[]
the data in UTF-8 encoding
data
)

Creates a small CLOB value that can be stored in the row directly.

public static ValueClob

Returns:

the CLOB
createSmall
(byte[]
the data in UTF-8 encoding
data
,
long
the count of characters, must be exactly the same as count of characters in the data
charLength
)

Creates a small CLOB value that can be stored in the row directly.

public static ValueClob

Returns:

the CLOB
createSmall
(String
the string with value
string
)

Creates a small CLOB value that can be stored in the row directly.

public static ValueClob

Returns:

the lob value
createTempClob
(Reader
the reader
in
,
long
the number of characters to read, or -1 for no limit
length
,
DataHandler
the data handler
handler
)

Create a temporary CLOB value from a stream.

private static ValueClob
createTemporary(DataHandler handler, Reader in, long remaining)

Create a CLOB in a temporary file.

pack-priv byte[]
public InputStream
public InputStream
getInputStream(long
the offset (1 means no offset)
oneBasedOffset
,
long
the requested length
length
)

Overrides org.h2.value.Value.getInputStream.

Get the input stream

public Reader
getReader(long
the offset (1 means no offset)
oneBasedOffset
,
long
the requested length
length
)

Overrides org.h2.value.Value.getReader.

Get the reader

public StringBuilder
getSQL(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Implements org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

public String
getString()

Implements abstract org.h2.value.Value.getString.

Get the value as a string.

public int
getValueType()

Implements abstract org.h2.value.Value.getValueType.

Get the value type.

public long
octetLength()

Overrides org.h2.value.Value.octetLength.

Returns length of this value in bytes.

Inherited from org.h2.value.ValueLob:
copyToResultcreateTempLobFileNameequalsformatLobDataCommentgetBinaryTooLonggetBufferSizegetBytesgetBytesNoCopygetLobDatagetMemorygetReadergetStringTooLonggetTypehashCodeisLinkedToTablerangeInputStreamrangeReaderreadBytesreadStringremove

Constructor Detail

ValueClobback to summary
public ValueClob(LobData lobData, long octetLength, long charLength)

Method Detail

charLengthback to summary
public long charLength()

Overrides org.h2.value.Value.charLength.

Doc from org.h2.value.Value.charLength.

Returns length of this value in characters.

Returns:long

length of this value in characters

Annotations
@Override
compareback to summary
private static int compare(ValueClob v1, ValueClob v2)

Compares two CLOB values directly.

Parameters
v1:ValueClob

first CLOB value

v2:ValueClob

second CLOB value

Returns:int

result of comparison

compareTypeSafeback to summary
public int compareTypeSafe(Value v, CompareMode mode, CastDataProvider provider)

Implements abstract org.h2.value.Value.compareTypeSafe.

Doc from org.h2.value.Value.compareTypeSafe.

Compare this value against another value given that the values are of the same data type.

Parameters
v:Value

the other value

mode:CompareMode

the compare mode

provider:CastDataProvider

the cast information provider

Returns:int

0 if both values are equal, -1 if the other value is smaller, and 1 otherwise

Annotations
@Override
convertPrecisionback to summary
pack-priv ValueClob convertPrecision(long precision)

Convert the precision to the requested value.

Parameters
precision:long

the new precision

Returns:ValueClob

the truncated or this value

copyback to summary
public ValueLob copy(DataHandler database, int tableId)

Implements abstract org.h2.value.ValueLob.copy.

Doc from org.h2.value.ValueLob.copy.

Copy a large value, to be used in the given table. For values that are kept fully in memory this method has no effect.

Parameters
database:DataHandler

the data handler

tableId:int

the table where this object is used

Returns:ValueLob

the new value or itself

Annotations
@Override
createSmallback to summary
public static ValueClob createSmall(byte[] data)

Creates a small CLOB value that can be stored in the row directly.

Parameters
data:byte[]

the data in UTF-8 encoding

Returns:ValueClob

the CLOB

createSmallback to summary
public static ValueClob createSmall(byte[] data, long charLength)

Creates a small CLOB value that can be stored in the row directly.

Parameters
data:byte[]

the data in UTF-8 encoding

charLength:long

the count of characters, must be exactly the same as count of characters in the data

Returns:ValueClob

the CLOB

createSmallback to summary
public static ValueClob createSmall(String string)

Creates a small CLOB value that can be stored in the row directly.

Parameters
string:String

the string with value

Returns:ValueClob

the CLOB

createTempClobback to summary
public static ValueClob createTempClob(Reader in, long length, DataHandler handler)

Create a temporary CLOB value from a stream.

Parameters
in:Reader

the reader

length:long

the number of characters to read, or -1 for no limit

handler:DataHandler

the data handler

Returns:ValueClob

the lob value

createTemporaryback to summary
private static ValueClob createTemporary(DataHandler handler, Reader in, long remaining) throws IOException

Create a CLOB in a temporary file.

getBytesInternalback to summary
pack-priv byte[] getBytesInternal()

Implements abstract org.h2.value.ValueLob.getBytesInternal.

Annotations
@Override
getInputStreamback to summary
public InputStream getInputStream()

Overrides org.h2.value.Value.getInputStream.

Annotations
@Override
getInputStreamback to summary
public InputStream getInputStream(long oneBasedOffset, long length)

Overrides org.h2.value.Value.getInputStream.

Doc from org.h2.value.Value.getInputStream.

Get the input stream

Parameters
oneBasedOffset:long

the offset (1 means no offset)

length:long

the requested length

Returns:InputStream

the new input stream

Annotations
@Override
getReaderback to summary
public Reader getReader(long oneBasedOffset, long length)

Overrides org.h2.value.Value.getReader.

Doc from org.h2.value.Value.getReader.

Get the reader

Parameters
oneBasedOffset:long

the offset (1 means no offset)

length:long

the requested length

Returns:Reader

the new reader

Annotations
@Override
getSQLback to summary
public StringBuilder getSQL(StringBuilder builder, int sqlFlags)

Implements org.h2.util.HasSQL.getSQL.

Doc from org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

Annotations
@Override
getStringback to summary
public String getString()

Implements abstract org.h2.value.Value.getString.

Doc from org.h2.value.Value.getString.

Get the value as a string.

Returns:String

the string

Annotations
@Override
getValueTypeback to summary
public int getValueType()

Implements abstract org.h2.value.Value.getValueType.

Doc from org.h2.value.Value.getValueType.

Get the value type.

Returns:int

the value type

Annotations
@Override
octetLengthback to summary
public long octetLength()

Overrides org.h2.value.Value.octetLength.

Doc from org.h2.value.Value.octetLength.

Returns length of this value in bytes.

Returns:long

length of this value in bytes

Annotations
@Override