Package org.apache.derby.impl.load
Class ImportLobFile
- java.lang.Object
-
- org.apache.derby.impl.load.ImportLobFile
-
class ImportLobFile extends java.lang.ObjectHelper 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.StringdataCodesetprivate ImportFileInputStreamlobInputStreamprivate LimitInputStreamlobLimitInprivate java.io.ReaderlobReader
-
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 voidclose()Close all the resources realated to the lob file.java.io.InputStreamgetBinaryStream(long offset, long length)Returns a stream that points to the lob data from file at the givenoffset.java.io.ReadergetCharacterStream(long offset, long length)Returns a stream that points to the clob data from file at the givenoffset.longgetClobDataLength(long offset, long length)Returns the clob data length in characters at the give location.java.lang.StringgetString(long offset, int length)Returns the clob data at the given location asString.private voidopenLobFile(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.ExceptionOpen 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.IOExceptionReturns 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.IOExceptionReturns 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.IOExceptionReturns 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.IOExceptionReturns 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.IOExceptionClose all the resources realated to the lob file.- Throws:
java.io.IOException
-
-