Class ImportLobFile

java.lang.Object
org.apache.derby.impl.load.ImportLobFile

class ImportLobFile extends Object
Helper class to read large object data at random locations from a file that contains large object data.
  • Field Details

  • Constructor Details

    • ImportLobFile

      ImportLobFile(File lobFile, String dataCodeset) throws 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:
      Exception
  • Method Details

    • openLobFile

      private void openLobFile(File lobFile) throws Exception
      Open the lob file and setup the stream required to read the data.
      Parameters:
      lobFile - the file that contains lob data.
      Throws:
      Exception - if an error occurs.
    • getBinaryStream

      public InputStream getBinaryStream(long offset, long length) throws 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:
      IOException - if any I/O error occurs.
    • getString

      public String getString(long offset, int length) throws 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:
      IOException - on any I/O error.
    • getCharacterStream

      public Reader getCharacterStream(long offset, long length) throws 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:
      IOException - on any I/O error.
    • getClobDataLength

      public long getClobDataLength(long offset, long length) throws 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:
      IOException - on any I/O error.
    • close

      public void close() throws IOException
      Close all the resources realated to the lob file.
      Throws:
      IOException