close
(package private) void close()
Closes this response stream. The stream id is unlinked from the
underlying shared socket as well.
getInputStream
(package private) InputStream getInputStream(int len)
Creates a simple
InputStream
over the server response.
This method can be used to obtain a stream which can be passed to
InputStreamReader
s to assist in reading multi byte
character sets.
len
- the number of bytes available in the server response
- the
InputStream
built over the server response
getPacket
private void getPacket()
throws IOException
Read the next TDS packet from the network.
getServerType
(package private) int getServerType()
Retrieves the server type.
- the server type as an
int
getStreamId
(package private) int getStreamId()
Retrieves the unique stream id.
- the unique stream id as an
int
getTdsVersion
(package private) int getTdsVersion()
Retrieves the TDS version number.
- the TDS version as an
int
peek
(package private) int peek()
throws IOException
Retrieves the next input byte without reading forward.
- the next byte in the input stream as an
int
read
(package private) int read()
throws IOException
Reads the next input byte from the server response stream.
- the next byte in the input stream as an
int
read
(package private) int read(byte[] b)
throws IOException
Reads a byte array from the server response stream.
b
- the byte array to read into
- the number of bytes read as an
int
read
(package private) int read(byte[] b,
int off,
int len)
throws IOException
Reads a byte array from the server response stream, specifying a start
offset and length.
b
- the byte arrayoff
- the starting offset in the arraylen
- the number of bytes to read
- the number of bytes read as an
int
read
(package private) int read(char[] c)
throws IOException
Reads a char array from the server response stream.
- the byte array as a
byte[]
readInt
(package private) int readInt()
throws IOException
Reads an int
value from the server response stream.
readLong
(package private) long readLong()
throws IOException
Reads a long
value from the server response stream.
readNonUnicodeString
(package private) String readNonUnicodeString(int len)
throws IOException
Reads a non Unicode String
from the server response stream,
creating the String
from a translated byte
array.
len
- the length of the string to read in bytes
readNonUnicodeString
(package private) String readNonUnicodeString(int len,
CharsetInfo charsetInfo)
throws IOException
Reads a String
from the server response stream, translating
it from a byte
array using the specified character set.
len
- the length of the string to read in bytes
readShort
(package private) short readShort()
throws IOException
Reads a short
value from the server response stream.
readString
(package private) String readString(int len)
throws IOException
Reads a String
object from the server response stream. If
the TDS protocol version is 4.2 or 5.0 decode the string use the default
server charset, otherwise use UCS2-LE (Unicode).
len
- the length of the string to read in bytes in the case
of TDS 4.2/5.0 and in characters for TDS 7.0+
(UCS2-LE encoded strings)
readString
(package private) String readString(int len,
CharsetInfo info)
throws IOException
Reads a String
from the server response stream, creating
it from a translated byte
array.
len
- the length of the string to read in bytesinfo
- descriptor of the charset to use
readUnicodeString
(package private) String readUnicodeString(int len)
throws IOException
Reads a UCS2-LE (Unicode) encoded String object from the server response
stream.
len
- the length of the string to read in characters
readUnsignedLong
(package private) BigDecimal readUnsignedLong()
throws IOException
Reads an unsigned long
value from the server response stream.
- the result as a
BigDecimal
skip
(package private) int skip(int skip)
throws IOException
Discards bytes from the server response stream.
skip
- the number of bytes to discard
- the number of bytes skipped
skipString
(package private) void skipString(int len)
throws IOException
Skips a String
from the server response stream. If the TDS
protocol version is 4.2 or 5.0 len
is the length in bytes,
otherwise it's the length in UCS2-LE characters (length in bytes == 2 *
len
).
len
- the length of the string to skip in bytes in the case
of TDS 4.2/5.0 and in characters for TDS 7.0+
(UCS2-LE encoded strings)
skipToEnd
(package private) void skipToEnd()
Consumes the rest of the server response, without parsing it.
Note: Use only in extreme cases, packets will not be parsed and
could leave the connection in an inconsistent state.