abstract class UpdateSensitiveLOBLocatorInputStream
extends java.io.InputStream
Modifier and Type | Field and Description |
---|---|
protected ClientConnection |
con |
protected long |
currentPos |
private java.io.BufferedInputStream |
is |
protected long |
length |
private Lob |
lob |
private long |
updateCount |
Modifier | Constructor and Description |
---|---|
protected |
UpdateSensitiveLOBLocatorInputStream(ClientConnection con,
Lob lob,
java.io.InputStream is)
Initializes the InputStream, updateCount, currentPos
and the connection to the appropriate values.
|
protected |
UpdateSensitiveLOBLocatorInputStream(ClientConnection 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 ClientConnection con
private Lob lob
private long updateCount
protected long currentPos
protected long length
protected UpdateSensitiveLOBLocatorInputStream(ClientConnection 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.SqlException
protected UpdateSensitiveLOBLocatorInputStream(ClientConnection 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.SqlException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
InputStream.read()
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
InputStream.read(byte[], int, int)
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
private 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
SqlException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.