org.h2.value

## Class ValueBlob

- java.lang.Object
- - org.h2.value.VersionedValue<Value>
  - - org.h2.value.Value
    - - org.h2.value.ValueLob
      - - org.h2.value.ValueBlob

All Implemented Interfaces:
  HasSQL, Typed

    public final class ValueBlob
    extends ValueLob

Implementation of the BINARY LARGE OBJECT data type.

### Field Summary

### Fields inherited from class org.h2.value.Value

`ARRAY, BIGINT, BINARY, BLOB, BOOLEAN, CHAR, CLOB, DATE, DECFLOAT, DOUBLE, EMPTY_VALUES, ENUM, GEOMETRY, INTEGER, INTERVAL_DAY, INTERVAL_DAY_TO_HOUR, INTERVAL_DAY_TO_MINUTE, INTERVAL_DAY_TO_SECOND, INTERVAL_HOUR, INTERVAL_HOUR_TO_MINUTE, INTERVAL_HOUR_TO_SECOND, INTERVAL_MINUTE, INTERVAL_MINUTE_TO_SECOND, INTERVAL_MONTH, INTERVAL_SECOND, INTERVAL_YEAR, INTERVAL_YEAR_TO_MONTH, JAVA_OBJECT, JSON, MIN_LONG_DECIMAL, NULL, NUMERIC, REAL, ROW, SMALLINT, TIME, TIME_TZ, TIMESTAMP, TIMESTAMP_TZ, TINYINT, TYPE_COUNT, UNKNOWN, UUID, VARBINARY, VARCHAR, VARCHAR_IGNORECASE`

### Fields inherited from interface org.h2.util.HasSQL

`ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS`

### Constructor Summary

Constructors
Constructor and Description
`ValueBlob(LobData lobData, long octetLength)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`long` `charLength()` Returns length of this value in characters.
`int` `compareTypeSafe(Value v, CompareMode mode, CastDataProvider provider)` Compare this value against another value given that the values are of the same data type.
`ValueLob` `copy(DataHandler database, int tableId)` Copy a large value, to be used in the given table.
`static ValueBlob` `createSmall(byte[] data)` Creates a small BLOB value that can be stored in the row directly.
`static ValueBlob` `createTempBlob(java.io.InputStream in, long length, DataHandler handler)` Create a temporary BLOB value from a stream.
`java.io.InputStream` `getInputStream()`
`java.io.InputStream` `getInputStream(long oneBasedOffset, long length)` Get the input stream
`java.io.Reader` `getReader(long oneBasedOffset, long length)` Get the reader
`java.lang.StringBuilder` `getSQL(java.lang.StringBuilder builder, int sqlFlags)` Appends the SQL statement of this object to the specified builder.
`java.lang.String` `getString()` Get the value as a string.
`int` `getValueType()` Get the value type.
`long` `octetLength()` Returns length of this value in bytes.

### Methods inherited from class org.h2.value.ValueLob

`copyToResult, equals, getBytes, getBytesNoCopy, getLobData, getMemory, getReader, getType, hashCode, isLinkedToTable, rangeInputStream, remove`

### Methods inherited from class org.h2.value.Value

`add, castTo, clearCache, compareTo, compareWithNull, containsNull, convertForAssignTo, convertTo, convertTo, convertTo, convertTo, convertTo, convertToAnyArray, convertToAnyRow, convertToBigint, convertToBoolean, convertToChar, convertToDate, convertToDouble, convertToEnum, convertToGeometry, convertToInt, convertToInt, convertToJavaObject, convertToReal, convertToSmallint, convertToTinyint, convertToUuid, divide, getBigDecimal, getBoolean, getByte, getDouble, getFloat, getHigherOrder, getInt, getLong, getShort, getSignum, getTypeName, getUnsupportedExceptionForOperation, isFalse, isTrue, modulus, multiply, negate, subtract, toString`

### Methods inherited from class org.h2.value.VersionedValue

`getCommittedValue, getCurrentValue, getOperationId, isCommitted`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.h2.util.HasSQL

`getSQL, getTraceSQL`

### Constructor Detail

#### ValueBlob

    public ValueBlob(LobData lobData,
                     long octetLength)

### Method Detail

#### createSmall

    public static ValueBlob createSmall(byte[] data)

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

Parameters:
  `data` - the data
Returns:
  the BLOB

#### createTempBlob

    public static ValueBlob createTempBlob(java.io.InputStream in,
                                           long length,
                                           DataHandler handler)

Create a temporary BLOB value from a stream.

Parameters:
  `in` - the input stream
  `length` - the number of characters to read, or -1 for no limit
  `handler` - the data handler
Returns:
  the lob value

#### getValueType

    public int getValueType()

Description copied from class: `Value`
Get the value type.

Specified by:
  `getValueType` in class `Value`
Returns:
  the value type

#### getString

    public java.lang.String getString()

Description copied from class: `Value`
Get the value as a string.

Specified by:
  `getString` in class `Value`
Returns:
  the string

#### getInputStream

    public java.io.InputStream getInputStream()

Overrides:
  `getInputStream` in class `Value`

#### getInputStream

    public java.io.InputStream getInputStream(long oneBasedOffset,
                                              long length)

Description copied from class: `Value`
Get the input stream

Overrides:
  `getInputStream` in class `Value`
Parameters:
  `oneBasedOffset` - the offset (1 means no offset)
  `length` - the requested length
Returns:
  the new input stream

#### getReader

    public java.io.Reader getReader(long oneBasedOffset,
                                    long length)

Description copied from class: `Value`
Get the reader

Overrides:
  `getReader` in class `Value`
Parameters:
  `oneBasedOffset` - the offset (1 means no offset)
  `length` - the requested length
Returns:
  the new reader

#### compareTypeSafe

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

Description copied from class: `Value`
Compare this value against another value given that the values are of the same data type.

Specified by:
  `compareTypeSafe` in class `Value`
Parameters:
  `v` - the other value
  `mode` - the compare mode
  `provider` - the cast information provider
Returns:
  0 if both values are equal, -1 if the other value is smaller, and 1 otherwise

#### getSQL

    public java.lang.StringBuilder getSQL(java.lang.StringBuilder builder,
                                          int sqlFlags)

Description copied from interface: `HasSQL`
Appends the SQL statement of this object to the specified builder.

Parameters:
  `builder` - string builder
  `sqlFlags` - formatting flags
Returns:
  the specified string builder

#### copy

    public ValueLob copy(DataHandler database,
                         int tableId)

Description copied from class: `ValueLob`
Copy a large value, to be used in the given table. For values that are kept fully in memory this method has no effect.

Specified by:
  `copy` in class `ValueLob`
Parameters:
  `database` - the data handler
  `tableId` - the table where this object is used
Returns:
  the new value or itself

#### charLength

    public long charLength()

Description copied from class: `Value`
Returns length of this value in characters.

Overrides:
  `charLength` in class `Value`
Returns:
  length of this value in characters

#### octetLength

    public long octetLength()

Description copied from class: `Value`
Returns length of this value in bytes.

Overrides:
  `octetLength` in class `Value`
Returns:
  length of this value in bytes