net.sourceforge.jtds.jdbc
Class JtdsInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--net.sourceforge.jtds.jdbc.JtdsInputStream
- public class JtdsInputStream
- extends java.io.InputStream
This class implements an InputStream populated with data returned by the
READTEXT command for image, text and ntext columns.
- Version:
- $Id: JtdsInputStream.java,v 1.7 2004/08/31 17:25:17 alin_sinpalean Exp $
- Author:
- Mike Hutchinson
Fields inherited from class java.io.InputStream |
SKIP_BUFFER_SIZE, skipBuffer |
Method Summary |
int |
available()
|
void |
close()
|
(package private) void |
fillBuffer()
Invoke READTEXT to obtain the next block of data from the server. |
int |
getLength()
|
int |
read()
|
void |
reset()
Resets the stream so that the data may be read from the specified offset. |
Methods inherited from class java.io.InputStream |
mark, markSupported, read, read, skip |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
tds
private TdsCore tds
length
private int length
offset
private int offset
colName
private java.lang.String colName
tabName
private java.lang.String tabName
textPtr
private TextPtr textPtr
BUFSIZE
private static final int BUFSIZE
buffer
private byte[] buffer
pos
private int pos
charset
private java.lang.String charset
JtdsInputStream
JtdsInputStream(ConnectionJDBC2 con,
ColInfo ci,
TextPtr textPtr,
java.lang.String charset)
throws java.sql.SQLException
- Construct a new InputStream.
- Parameters:
con
- The parent connection object.ci
- The descriptor for the text or image column.textPtr
- The textpointer.charset
- The character set for converting strings to bytes.- Throws:
java.sql.SQLException
-
available
public int available()
throws java.io.IOException
- Overrides:
available
in class java.io.InputStream
getLength
public int getLength()
reset
public void reset()
throws java.io.IOException
- Resets the stream so that the data may be read from the specified offset.
- Overrides:
reset
in class java.io.InputStream
- Throws:
java.io.IOException
- if offset
is less 0
;
if offset
is greater than getLength()
;
fillBuffer
void fillBuffer()
throws java.sql.SQLException
- Invoke READTEXT to obtain the next block of data from the server.
- Throws:
java.sql.SQLException
-
read
public int read()
throws java.io.IOException
- Overrides:
read
in class java.io.InputStream
close
public void close()
throws java.io.IOException
- Overrides:
close
in class java.io.InputStream
Generated on April 15 2005