Top Description Fields Constructors Methods
org.h2.value

public final Class ValueBlob

extends ValueLob
Class Inheritance
Imports
java.io.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, org.h2.util.IOUtils, .MathUtils, .StringUtils, .Utils, org.h2.value.lob.LobData, .LobDataDatabase, .LobDataFetchOnDemand, .LobDataFile, .LobDataInMemory

Implementation of the BINARY LARGE OBJECT data type.

Field Summary

Inherited from org.h2.value.ValueLob:
BLOCK_COMPARISON_SIZEcharLengthlobDataoctetLength

Constructor Summary

AccessConstructor and Description
public
ValueBlob(LobData lobData, long octetLength)

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
(ValueBlob
first BLOB value
v1
,
ValueBlob
second BLOB value
v2
)

Compares two BLOB 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 ValueBlob

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 ValueBlob

Returns:

the BLOB
createSmall
(byte[]
the data
data
)

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

public static ValueBlob

Returns:

the lob value
createTempBlob
(InputStream
the input stream
in
,
long
the number of characters to read, or -1 for no limit
length
,
DataHandler
the data handler
handler
)

Create a temporary BLOB value from a stream.

private static ValueBlob
createTemporary(DataHandler handler, byte[] buff, int len, InputStream in, long remaining)

Create a BLOB 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

ValueBlobback to summary
public ValueBlob(LobData lobData, long octetLength)

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(ValueBlob v1, ValueBlob v2)

Compares two BLOB values directly.

Parameters
v1:ValueBlob

first BLOB value

v2:ValueBlob

second BLOB 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 ValueBlob convertPrecision(long precision)

Convert the precision to the requested value.

Parameters
precision:long

the new precision

Returns:ValueBlob

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 ValueBlob createSmall(byte[] data)

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

Parameters
data:byte[]

the data

Returns:ValueBlob

the BLOB

createTempBlobback to summary
public static ValueBlob createTempBlob(InputStream in, long length, DataHandler handler)

Create a temporary BLOB value from a stream.

Parameters
in:InputStream

the input stream

length:long

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

handler:DataHandler

the data handler

Returns:ValueBlob

the lob value

createTemporaryback to summary
private static ValueBlob createTemporary(DataHandler handler, byte[] buff, int len, InputStream in, long remaining) throws IOException

Create a BLOB 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