Package org.apache.derby.impl.load
Class ImportLobFile
- java.lang.Object
-
- org.apache.derby.impl.load.ImportLobFile
-
class ImportLobFile extends java.lang.Object
Helper class to read large object data at random locations from a file that contains large object data.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
dataCodeset
private ImportFileInputStream
lobInputStream
private LimitInputStream
lobLimitIn
private java.io.Reader
lobReader
-
Constructor Summary
Constructors Constructor Description ImportLobFile(java.io.File lobFile, java.lang.String dataCodeset)
Create a ImportLobFile object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close all the resources realated to the lob file.java.io.InputStream
getBinaryStream(long offset, long length)
Returns a stream that points to the lob data from file at the givenoffset
.java.io.Reader
getCharacterStream(long offset, long length)
Returns a stream that points to the clob data from file at the givenoffset
.long
getClobDataLength(long offset, long length)
Returns the clob data length in characters at the give location.java.lang.String
getString(long offset, int length)
Returns the clob data at the given location asString
.private void
openLobFile(java.io.File lobFile)
Open the lob file and setup the stream required to read the data.
-
-
-
Field Detail
-
lobInputStream
private ImportFileInputStream lobInputStream
-
lobLimitIn
private LimitInputStream lobLimitIn
-
lobReader
private java.io.Reader lobReader
-
dataCodeset
private java.lang.String dataCodeset
-
-
Method Detail
-
openLobFile
private void openLobFile(java.io.File lobFile) throws java.lang.Exception
Open the lob file and setup the stream required to read the data.- Parameters:
lobFile
- the file that contains lob data.- Throws:
java.lang.Exception
- if an error occurs.
-
getBinaryStream
public java.io.InputStream getBinaryStream(long offset, long length) throws java.io.IOException
Returns a stream that points to the lob data from file at the givenoffset
.- Parameters:
offset
- byte offset of the column data in the file.length
- length of the the data.- Throws:
java.io.IOException
- if any I/O error occurs.
-
getString
public java.lang.String getString(long offset, int length) throws java.io.IOException
Returns the clob data at the given location asString
.- Parameters:
offset
- byte offset of the column data in the file.length
- length of the the data.- Throws:
java.io.IOException
- on any I/O error.
-
getCharacterStream
public java.io.Reader getCharacterStream(long offset, long length) throws java.io.IOException
Returns a stream that points to the clob data from file at the givenoffset
.- Parameters:
offset
- byte offset of the column data in the file.length
- length of the the data in bytes.- Throws:
java.io.IOException
- on any I/O error.
-
getClobDataLength
public long getClobDataLength(long offset, long length) throws java.io.IOException
Returns the clob data length in characters at the give location.- Parameters:
offset
- byte offset of the column data in the file.length
- length of the the data in bytes.- Throws:
java.io.IOException
- on any I/O error.
-
close
public void close() throws java.io.IOException
Close all the resources realated to the lob file.- Throws:
java.io.IOException
-
-