Class 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.
    • 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 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​(long 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

      • 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​(long 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