public abstract class UpdateSensitiveLOBLocatorInputStream
extends java.io.InputStream
| Modifier and Type | Field and Description |
|---|---|
protected Connection |
con |
protected long |
currentPos |
private java.io.BufferedInputStream |
is |
protected long |
length |
private Lob |
lob |
private long |
updateCount |
| Modifier | Constructor and Description |
|---|---|
protected |
UpdateSensitiveLOBLocatorInputStream(Connection con,
Lob lob,
java.io.InputStream is)
Initializes the InputStream, updateCount, currentPos
and the connection to the appropriate values.
|
protected |
UpdateSensitiveLOBLocatorInputStream(Connection con,
Lob lob,
java.io.InputStream is,
long pos,
long len)
Initializes the InputStream, updateCount, currentPos,
length and the connection to the appropriate values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
private void |
identifyAndReplaceObseleteStream()
Verifies whether the current updateCount matches
the updateCount of the LOB object and if it does
not it recreates the stream.
|
int |
read() |
int |
read(byte[] b,
int off,
int len) |
protected abstract java.io.InputStream |
reCreateStream()
Abstract method that will be implemented by
the underlying streams specific to Clob and
Blob.
|
private java.io.BufferedInputStream is
protected Connection con
private Lob lob
private long updateCount
protected long currentPos
protected long length
protected UpdateSensitiveLOBLocatorInputStream(Connection con, Lob lob, java.io.InputStream is) throws SqlException
con - connection to be used to read the
Lob value from the serverlob - Lob object which could be a
Blob or a Clob.is - an InputStream that contains the
appropriate locator stream instance.SqlExceptionprotected UpdateSensitiveLOBLocatorInputStream(Connection con, Lob lob, java.io.InputStream is, long pos, long len) throws SqlException
con - connection to be used to read the
Lob value from the serverlob - Lob object which could be a
Blob or a Clob.is - an InputStream that contains the
appropriate locator stream instance.pos - the position from which the first read begins.len - the length in bytes of the partial value to be
retrieved.SqlExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionInputStream.read()public int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionInputStream.read(byte[], int, int)public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionprivate void identifyAndReplaceObseleteStream()
throws java.io.IOException
java.io.IOException - If any exception occurs upon
Locator stream creation.protected abstract java.io.InputStream reCreateStream()
throws SqlException
SqlExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.