net.sourceforge.jtds.util
Class BlobBuffer.AsciiInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended bynet.sourceforge.jtds.util.BlobBuffer.AsciiInputStream
Enclosing class:
BlobBuffer

private class BlobBuffer.AsciiInputStream
extends java.io.InputStream

An ASCII InputStream over the CLOB buffer.

This class interprets ASCII as anything which has a value below 0x80. This is more rigid than other drivers which allow any character below 0x100 to be converted to returned. The more relaxed coding is useful when dealing with most single byte character sets and if this behaviour is desired, comment out the line indicated in the read method.


Field Summary
private  boolean open
           
private  int readPtr
           
 
Fields inherited from class java.io.InputStream
 
Constructor Summary
BlobBuffer.AsciiInputStream(long pos)
          Costructs an InputStream object over the BLOB buffer.
 
Method Summary
 int available()
          Returns the number of bytes available to read.
 void close()
          Closes the output stream.
protected  void finalize()
          Ensures underlying BLOB file can be closed even if user does not close this stream.
 int read()
          Read the next byte from the stream.
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readPtr

private int readPtr

open

private boolean open
Constructor Detail

BlobBuffer.AsciiInputStream

public BlobBuffer.AsciiInputStream(long pos)
                            throws java.io.IOException
Costructs an InputStream object over the BLOB buffer.

Parameters:
pos - the starting position (from 0)
Throws:
java.io.IOException - if an I/O error occurs
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Ensures underlying BLOB file can be closed even if user does not close this stream.

Throws:
java.lang.Throwable

available

public int available()
              throws java.io.IOException
Returns the number of bytes available to read.

Throws:
java.io.IOException - if an I/O error occurs

read

public int read()
         throws java.io.IOException
Read the next byte from the stream.

Returns:
the next byte as an int or -1 if at EOF
Throws:
java.io.IOException - if an I/O error occurs

close

public void close()
           throws java.io.IOException
Closes the output stream.

Throws:
java.io.IOException - if an I/O error occurs


Generated on October 27 2012