Top Description Fields Constructors Methods
org.apache.derby.impl.load

pack-priv Class ImportLobFile

Additional top-level class in compilation unit: ImportFileInputStream.

extends Object
Class Inheritance
Imports
java.io.File, .RandomAccessFile, .InputStreamReader, .InputStream, .IOException, .Reader, .FileNotFoundException, org.apache.derby.iapi.services.io.LimitInputStream, org.apache.derby.shared.common.error.PublicAPI, .StandardException, org.apache.derby.shared.common.reference.SQLState

Helper class to read large object data at random locations from a file that contains large object data.

Field Summary

Modifier and TypeField and Description
private String
private ImportFileInputStream
private LimitInputStream
private Reader

Constructor Summary

AccessConstructor and Description
pack-priv
ImportLobFile(File
the file which has the LOB Data.
lobFile
,
String
the code set to use char data in the file.
dataCodeset
)

Create a ImportLobFile object.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Close all the resources realated to the lob file.

public InputStream
getBinaryStream(long
byte offset of the column data in the file.
offset
,
long
length of the the data.
length
)

Returns a stream that points to the lob data from file at the given offset.

public Reader
getCharacterStream(long
byte offset of the column data in the file.
offset
,
long
length of the the data in bytes.
length
)

Returns a stream that points to the clob data from file at the given offset.

public long
getClobDataLength(long
byte offset of the column data in the file.
offset
,
long
length of the the data in bytes.
length
)

Returns the clob data length in characters at the give location.

public String
getString(long
byte offset of the column data in the file.
offset
,
int
length of the the data.
length
)

Returns the clob data at the given location as String.

private void
openLobFile(final File
the file that contains lob data.
lobFile
)

Open the lob file and setup the stream required to read the data.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dataCodesetback to summary
private String dataCodeset
lobInputStreamback to summary
private ImportFileInputStream lobInputStream
lobLimitInback to summary
private LimitInputStream lobLimitIn
lobReaderback to summary
private Reader lobReader

Constructor Detail

ImportLobFileback to summary
pack-priv ImportLobFile(File lobFile, String dataCodeset) throws Exception

Create a ImportLobFile object.

Parameters
lobFile:File

the file which has the LOB Data.

dataCodeset:String

the code set to use char data in the file.

Method Detail

closeback to summary
public void close() throws IOException

Close all the resources realated to the lob file.

getBinaryStreamback to summary
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:long

byte offset of the column data in the file.

length:long

length of the the data.

Exceptions
IOException:
if any I/O error occurs.
getCharacterStreamback to summary
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:long

byte offset of the column data in the file.

length:long

length of the the data in bytes.

Exceptions
IOException:
on any I/O error.
getClobDataLengthback to summary
public long getClobDataLength(long offset, long length) throws IOException

Returns the clob data length in characters at the give location.

Parameters
offset:long

byte offset of the column data in the file.

length:long

length of the the data in bytes.

Exceptions
IOException:
on any I/O error.
getStringback to summary
public String getString(long offset, int length) throws IOException

Returns the clob data at the given location as String.

Parameters
offset:long

byte offset of the column data in the file.

length:int

length of the the data.

Exceptions
IOException:
on any I/O error.
openLobFileback to summary
private void openLobFile(final File lobFile) throws Exception

Open the lob file and setup the stream required to read the data.

Parameters
lobFile:File

the file that contains lob data.

Exceptions
Exception:
if an error occurs.