Package org.h2.store
Interface LobStorageInterface
-
- All Known Implementing Classes:
LobStorageFrontend,LobStorageMap
public interface LobStorageInterfaceA mechanism to store and retrieve lob data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ValueLobcopyLob(ValueLob old, int tableId)Copy a lob.ValueBlobcreateBlob(java.io.InputStream in, long maxLength)Create a BLOB object.ValueClobcreateClob(java.io.Reader reader, long maxLength)Create a CLOB object.java.io.InputStreamgetInputStream(long lobId, int tableId, long byteCount)Get the input stream for the given lobjava.io.InputStreamgetInputStream(long lobId, long byteCount)Get the input stream for the given lob, only called on server side of a TCP connection.booleanisReadOnly()Whether the storage is read-onlyvoidremoveAllForTable(int tableId)Remove all LOBs for this table.voidremoveLob(ValueLob lob)Delete a LOB (from the database, if it is stored there).
-
-
-
Method Detail
-
createClob
ValueClob createClob(java.io.Reader reader, long maxLength)
Create a CLOB object.- Parameters:
reader- the readermaxLength- the maximum length (-1 if not known)- Returns:
- the LOB
-
createBlob
ValueBlob createBlob(java.io.InputStream in, long maxLength)
Create a BLOB object.- Parameters:
in- the input streammaxLength- the maximum length (-1 if not known)- Returns:
- the LOB
-
copyLob
ValueLob copyLob(ValueLob old, int tableId)
Copy a lob.- Parameters:
old- the old lobtableId- the new table id- Returns:
- the new lob
-
getInputStream
java.io.InputStream getInputStream(long lobId, long byteCount) throws java.io.IOExceptionGet the input stream for the given lob, only called on server side of a TCP connection.- Parameters:
lobId- the lob idbyteCount- the number of bytes to read, or -1 if not known- Returns:
- the stream
- Throws:
java.io.IOException- on failure
-
getInputStream
java.io.InputStream getInputStream(long lobId, int tableId, long byteCount) throws java.io.IOExceptionGet the input stream for the given lob- Parameters:
lobId- the lob idtableId- the able idbyteCount- the number of bytes to read, or -1 if not known- Returns:
- the stream
- Throws:
java.io.IOException- on failure
-
removeLob
void removeLob(ValueLob lob)
Delete a LOB (from the database, if it is stored there).- Parameters:
lob- the lob
-
removeAllForTable
void removeAllForTable(int tableId)
Remove all LOBs for this table.- Parameters:
tableId- the table id
-
isReadOnly
boolean isReadOnly()
Whether the storage is read-only- Returns:
- true if yes
-
-