Package org.h2.store
Class LobStorageFrontend
java.lang.Object
org.h2.store.LobStorageFrontend
- All Implemented Interfaces:
LobStorageInterface
This factory creates in-memory objects and temporary files. It is used on the
client side.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SessionRemote
static final int
The table id for session variables (LOBs not assigned to a table).static final int
The table id for result sets.static final int
The table id for temporary objects (not assigned to any object). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCopy a lob.createBlob
(InputStream in, long maxLength) Create a BLOB object.createClob
(Reader reader, long maxLength) Create a CLOB object.getInputStream
(long lobId, int tableId, long byteCount) Get the input stream for the given lobgetInputStream
(long lobId, long byteCount) Get the input stream for the given lob, only called on server side of a TCP connection.boolean
Whether the storage is read-onlyvoid
removeAllForTable
(int tableId) Remove all LOBs for this table.void
Delete a LOB (from the database, if it is stored there).
-
Field Details
-
TABLE_ID_SESSION_VARIABLE
public static final int TABLE_ID_SESSION_VARIABLEThe table id for session variables (LOBs not assigned to a table).- See Also:
-
TABLE_TEMP
public static final int TABLE_TEMPThe table id for temporary objects (not assigned to any object).- See Also:
-
TABLE_RESULT
public static final int TABLE_RESULTThe table id for result sets.- See Also:
-
sessionRemote
-
-
Constructor Details
-
LobStorageFrontend
-
-
Method Details
-
removeLob
Description copied from interface:LobStorageInterface
Delete a LOB (from the database, if it is stored there).- Specified by:
removeLob
in interfaceLobStorageInterface
- Parameters:
lob
- the lob
-
getInputStream
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 interfaceLobStorageInterface
- Parameters:
lobId
- the lob idbyteCount
- the number of bytes to read, or -1 if not known- Returns:
- the stream
- Throws:
IOException
- on failure
-
getInputStream
Description copied from interface:LobStorageInterface
Get the input stream for the given lob- Specified by:
getInputStream
in interfaceLobStorageInterface
- Parameters:
lobId
- the lob idtableId
- the able idbyteCount
- 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 interfaceLobStorageInterface
- Returns:
- true if yes
-
copyLob
Description copied from interface:LobStorageInterface
Copy a lob.- Specified by:
copyLob
in interfaceLobStorageInterface
- Parameters:
old
- the old lobtableId
- 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 interfaceLobStorageInterface
- Parameters:
tableId
- the table id
-
createBlob
Description copied from interface:LobStorageInterface
Create a BLOB object.- Specified by:
createBlob
in interfaceLobStorageInterface
- Parameters:
in
- the input streammaxLength
- the maximum length (-1 if not known)- Returns:
- the LOB
-
createClob
Create a CLOB object.- Specified by:
createClob
in interfaceLobStorageInterface
- Parameters:
reader
- the readermaxLength
- the maximum length (-1 if not known)- Returns:
- the LOB
-