org.apache.derby.impl.load
Class ImportLobFile

java.lang.Object
  extended by 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
private  java.lang.String dataCodeset
           
private  ImportFileInputStream lobInputStream
           
private  LimitInputStream lobLimitIn
           
private  java.io.Reader lobReader
           
 
Constructor Summary
ImportLobFile(java.io.File lobFile, java.lang.String dataCodeset)
          Create a ImportLobFile object.
 
Method Summary
 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 given offset.
 java.io.Reader getCharacterStream(long offset, long length)
          Returns a stream that points to the clob data from file at the given offset.
 long getClobDataLength(long offset, long length)
          Returns the clob data length in characters at the give location.
 java.lang.String getString(int offset, int length)
          Returns the clob data at the given location as String.
private  void openLobFile(java.io.File lobFile)
          Open the lob file and setup the stream required to read the data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lobInputStream

private ImportFileInputStream lobInputStream

lobLimitIn

private LimitInputStream lobLimitIn

lobReader

private java.io.Reader lobReader

dataCodeset

private java.lang.String dataCodeset
Constructor Detail

ImportLobFile

ImportLobFile(java.io.File lobFile,
              java.lang.String dataCodeset)
        throws java.lang.Exception
Create a ImportLobFile object.

Parameters:
lobFile - the file which has the LOB Data.
dataCodeset - the code set to use char data in the file.
Throws:
java.lang.Exception
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 given offset.

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(int offset,
                                  int length)
                           throws java.io.IOException
Returns the clob data at the given location as String.

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 given offset.

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

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.