Package net.sourceforge.jtds.ssl
Class TdsTlsInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
net.sourceforge.jtds.ssl.TdsTlsInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
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.5 2005-10-20 09:46:38 alin_sinpalean Exp $
- Author:
- Rob Worsnop, Mike Hutchinson
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) InputStream
(package private) int
(package private) boolean
False if TLS packets are encapsulated in TDS packets.(package private) final byte[]
Temporary buffer used to de-encapsulate inital TLS packets.Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a TdsTlsInputStream and bases it on an underlying stream. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
Read in entire TLS record or TDS packet and store the TLS record in the buffer.int
read
(byte[] b, int off, int len) private void
readFully
(byte[] b, int off, int len) Readslen
bytes or throws anIOException
if there aren't that many bytes available.Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, reset, skip
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
bytesOutstanding
int bytesOutstanding -
readBuffer
final byte[] readBufferTemporary buffer used to de-encapsulate inital TLS packets. Initial size should be enough for login phase after which no buffering is required. -
bufferStream
InputStream bufferStream -
pureSSL
boolean pureSSLFalse if TLS packets are encapsulated in TDS packets.
-
-
Constructor Details
-
TdsTlsInputStream
Constructs a TdsTlsInputStream and bases it on an underlying stream.- Parameters:
in
- the underlying stream
-
-
Method Details
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
primeBuffer
Read in entire TLS record or TDS packet and store the TLS record in the buffer. (TDS packets will always contain a TLS record.)- Throws:
IOException
-
readFully
Readslen
bytes or throws anIOException
if there aren't that many bytes available.- Parameters:
b
- buffer to read intooff
- offset in the buffer where to start storinglen
- amount of data to read- Throws:
IOException
- if an I/O error occurs or not enough data is available
-