Package org.h2.store

# Class LobStorageFrontend

java.lang.Object
org.h2.store.LobStorageFrontend

All Implemented Interfaces:
  `LobStorageInterface`

public class LobStorageFrontend extends Object implements LobStorageInterface
This factory creates in-memory objects and temporary files. It is used on the client side.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`TABLE_ID_SESSION_VARIABLE`
The table id for session variables (LOBs not assigned to a table).
`static final int`
`TABLE_RESULT`
The table id for result sets.
`static final int`
`TABLE_TEMP`
The table id for temporary objects (not assigned to any object).

## Constructor Summary

Constructors
Constructor
Description
`LobStorageFrontend(SessionRemote handler)`

## Method Summary

Modifier and Type
Method
Description
`ValueLob`
`copyLob(ValueLob old, int tableId)`
Copy a lob.
`ValueBlob`
`createBlob(InputStream in, long maxLength)`
Create a BLOB object.
`ValueClob`
`createClob(Reader reader, long maxLength)`
Create a CLOB object.
`InputStream`
`getInputStream(long lobId, int tableId, long byteCount)`
Get the input stream for the given lob
`InputStream`
`getInputStream(long lobId, long byteCount)`
Get the input stream for the given lob, only called on server side of a TCP connection.
`boolean`
`isReadOnly()`
Whether the storage is read-only
`void`
`removeAllForTable(int tableId)`
Remove all LOBs for this table.
`void`
`removeLob(ValueLob lob)`
Delete a LOB (from the database, if it is stored there).

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.h2.store.LobStorageInterface

`close`

## Field Details

### TABLE_ID_SESSION_VARIABLE

public static final int TABLE_ID_SESSION_VARIABLE
The table id for session variables (LOBs not assigned to a table).

See Also:
  - Constant Field Values

### TABLE_TEMP

public static final int TABLE_TEMP
The table id for temporary objects (not assigned to any object).

See Also:
  - Constant Field Values

### TABLE_RESULT

public static final int TABLE_RESULT
The table id for result sets.

See Also:
  - Constant Field Values

## Constructor Details

### LobStorageFrontend

public LobStorageFrontend(SessionRemote handler)

## Method Details

### removeLob

public void removeLob(ValueLob lob)
Description copied from interface: `LobStorageInterface`
Delete a LOB (from the database, if it is stored there).

Specified by:
  `removeLob` in interface `LobStorageInterface`
Parameters:
  `lob` - the lob

### getInputStream

public InputStream getInputStream(long lobId, long byteCount) throws IOException
Description copied from interface: `LobStorageInterface`
Get the input stream for the given lob, only called on server side of a TCP connection.

Specified by:
  `getInputStream` in interface `LobStorageInterface`
Parameters:
  `lobId` - the lob id
  `byteCount` - the number of bytes to read, or -1 if not known
Returns:
  the stream
Throws:
  `IOException` - on failure

### getInputStream

public InputStream getInputStream(long lobId, int tableId, long byteCount) throws IOException
Description copied from interface: `LobStorageInterface`
Get the input stream for the given lob

Specified by:
  `getInputStream` in interface `LobStorageInterface`
Parameters:
  `lobId` - the lob id
  `tableId` - the able id
  `byteCount` - the number of bytes to read, or -1 if not known
Returns:
  the stream
Throws:
  `IOException` - on failure

### isReadOnly

public boolean isReadOnly()
Description copied from interface: `LobStorageInterface`
Whether the storage is read-only

Specified by:
  `isReadOnly` in interface `LobStorageInterface`
Returns:
  true if yes

### copyLob

public ValueLob copyLob(ValueLob old, int tableId)
Description copied from interface: `LobStorageInterface`
Copy a lob.

Specified by:
  `copyLob` in interface `LobStorageInterface`
Parameters:
  `old` - the old lob
  `tableId` - the new table id
Returns:
  the new lob

### removeAllForTable

public void removeAllForTable(int tableId)
Description copied from interface: `LobStorageInterface`
Remove all LOBs for this table.

Specified by:
  `removeAllForTable` in interface `LobStorageInterface`
Parameters:
  `tableId` - the table id

### createBlob

public ValueBlob createBlob(InputStream in, long maxLength)
Description copied from interface: `LobStorageInterface`
Create a BLOB object.

Specified by:
  `createBlob` in interface `LobStorageInterface`
Parameters:
  `in` - the input stream
  `maxLength` - the maximum length (-1 if not known)
Returns:
  the LOB

### createClob

public ValueClob createClob(Reader reader, long maxLength)
Create a CLOB object.

Specified by:
  `createClob` in interface `LobStorageInterface`
Parameters:
  `reader` - the reader
  `maxLength` - the maximum length (-1 if not known)
Returns:
  the LOB