net.sourceforge.jtds.ssl
Class TdsTlsInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--java.io.FilterInputStream
              |
              +--net.sourceforge.jtds.ssl.TdsTlsInputStream

class TdsTlsInputStream
extends java.io.FilterInputStream

An input stream that filters out TDS headers so they are not returned to JSSE (which will not recognize them).

Version:
$Id: TdsTlsInputStream.java,v 1.2 2005/02/02 00:43:10 alin_sinpalean Exp $
Author:
Rob Worsnop, Mike Hutchinson

Field Summary
(package private)  java.io.InputStream bufferStream
           
(package private)  int bytesOutstanding
           
(package private)  boolean pureSSL
          False if TLS packets are encapsulated in TDS packets.
(package private)  byte[] readBuffer
          Temporary buffer used to de-encapsulate inital TLS packets.
 
Fields inherited from class java.io.FilterInputStream
in
 
Fields inherited from class java.io.InputStream
SKIP_BUFFER_SIZE, skipBuffer
 
Constructor Summary
TdsTlsInputStream(java.io.InputStream in)
          Constructs a TdsTlsInputStream and bases it on an underlying stream.
 
Method Summary
private  void primeBuffer()
          Read in entire TLS record or TDS packet and store the TLS record in the buffer.
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

bytesOutstanding

int bytesOutstanding

readBuffer

byte[] readBuffer
Temporary buffer used to de-encapsulate inital TLS packets. Initial size should be enough for login phase after which no buffering is required.

bufferStream

java.io.InputStream bufferStream

pureSSL

boolean pureSSL
False if TLS packets are encapsulated in TDS packets.
Constructor Detail

TdsTlsInputStream

public TdsTlsInputStream(java.io.InputStream in)
Constructs a TdsTlsInputStream and bases it on an underlying stream.
Parameters:
in - the underlying stream
Method Detail

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream

primeBuffer

private void primeBuffer()
                  throws java.io.IOException
Read in entire TLS record or TDS packet and store the TLS record in the buffer. (TDS packets will always contain a TLS record.)


Generated on April 15 2005