Java Doc for ResponseStream.java in  » Database-JDBC-Connection-Pool » jTDS » net » sourceforge » jtds » jdbc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database JDBC Connection Pool » jTDS » net.sourceforge.jtds.jdbc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sourceforge.jtds.jdbc.ResponseStream

ResponseStream
public class ResponseStream (Code)
Implements an input stream for the server response.

Implementation note:

  1. This class contains methods to read different types of data from the server response stream in TDS format.
  2. Character translation of String items is carried out.

author:
   Mike Hutchinson.
version:
   $Id: ResponseStream.java,v 1.20 2005/10/27 13:22:33 alin_sinpalean Exp $



Constructor Summary
 ResponseStream(SharedSocket socket, int streamId, int bufferSize)
     Constructs a RequestStream object.

Method Summary
 voidclose()
     Closes this response stream.
 InputStreamgetInputStream(int len)
     Creates a simple InputStream over the server response.
 intgetServerType()
     Retrieves the server type.
 intgetStreamId()
     Retrieves the unique stream id.
 intgetTdsVersion()
     Retrieves the TDS version number.
 intpeek()
     Retrieves the next input byte without reading forward.
 intread()
     Reads the next input byte from the server response stream.
 intread(byte[] b)
     Reads a byte array from the server response stream.
 intread(byte[] b, int off, int len)
     Reads a byte array from the server response stream, specifying a start offset and length.
 intread(char[] c)
     Reads a char array from the server response stream.
 intreadInt()
     Reads an int value from the server response stream.
 longreadLong()
     Reads a long value from the server response stream.
 StringreadNonUnicodeString(int len)
     Reads a non Unicode String from the server response stream, creating the String from a translated byte array.
 StringreadNonUnicodeString(int len, CharsetInfo charsetInfo)
     Reads a String from the server response stream, translating it from a byte array using the specified character set.
 shortreadShort()
     Reads a short value from the server response stream.
 StringreadString(int len)
     Reads a String object from the server response stream.
 StringreadString(int len, CharsetInfo info)
     Reads a String from the server response stream, creating it from a translated byte array.
 StringreadUnicodeString(int len)
     Reads a UCS2-LE (Unicode) encoded String object from the server response stream.
 BigDecimalreadUnsignedLong()
     Reads an unsigned long value from the server response stream.
 intskip(int skip)
     Discards bytes from the server response stream.
 voidskipString(int len)
     Skips a String from the server response stream.
 voidskipToEnd()
     Consumes the rest of the server response, without parsing it.


Constructor Detail
ResponseStream
ResponseStream(SharedSocket socket, int streamId, int bufferSize)(Code)
Constructs a RequestStream object.
Parameters:
  socket - the shared socket object to write to
Parameters:
  streamId - the unique id for this stream (from ResponseStream)
Parameters:
  bufferSize - the initial buffer size




Method Detail
close
void close()(Code)
Closes this response stream. The stream id is unlinked from the underlying shared socket as well.



getInputStream
InputStream getInputStream(int len)(Code)
Creates a simple InputStream over the server response.

This method can be used to obtain a stream which can be passed to InputStreamReaders to assist in reading multi byte character sets.
Parameters:
  len - the number of bytes available in the server response the InputStream built over the server response




getServerType
int getServerType()(Code)
Retrieves the server type. the server type as an int



getStreamId
int getStreamId()(Code)
Retrieves the unique stream id. the unique stream id as an int



getTdsVersion
int getTdsVersion()(Code)
Retrieves the TDS version number. the TDS version as an int



peek
int peek() throws IOException(Code)
Retrieves the next input byte without reading forward. the next byte in the input stream as an int
throws:
  IOException - if an I/O error occurs



read
int read() throws IOException(Code)
Reads the next input byte from the server response stream. the next byte in the input stream as an int
throws:
  IOException - if an I/O error occurs



read
int read(byte[] b) throws IOException(Code)
Reads a byte array from the server response stream.
Parameters:
  b - the byte array to read into the number of bytes read as an int
throws:
  IOException - if an I/O error occurs



read
int read(byte[] b, int off, int len) throws IOException(Code)
Reads a byte array from the server response stream, specifying a start offset and length.
Parameters:
  b - the byte array
Parameters:
  off - the starting offset in the array
Parameters:
  len - the number of bytes to read the number of bytes read as an int
throws:
  IOException - if an I/O error occurs



read
int read(char[] c) throws IOException(Code)
Reads a char array from the server response stream.
Parameters:
  c - the char array the byte array as a byte[]
throws:
  IOException - if an I/O error occurs



readInt
int readInt() throws IOException(Code)
Reads an int value from the server response stream. the result as a int
throws:
  IOException - if an I/O error occurs



readLong
long readLong() throws IOException(Code)
Reads a long value from the server response stream. the result as a long
throws:
  IOException - if an I/O error occurs



readNonUnicodeString
String readNonUnicodeString(int len) throws IOException(Code)
Reads a non Unicode String from the server response stream, creating the String from a translated byte array.
Parameters:
  len - the length of the string to read in bytes the result as a String
throws:
  IOException - if an I/O error occurs



readNonUnicodeString
String readNonUnicodeString(int len, CharsetInfo charsetInfo) throws IOException(Code)
Reads a String from the server response stream, translating it from a byte array using the specified character set.
Parameters:
  len - the length of the string to read in bytes the result as a String
throws:
  IOException - if an I/O error occurs



readShort
short readShort() throws IOException(Code)
Reads a short value from the server response stream. the result as a short
throws:
  IOException - if an I/O error occurs



readString
String readString(int len) throws IOException(Code)
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).
Parameters:
  len - the length of the string to read in bytes in the caseof TDS 4.2/5.0 and in characters for TDS 7.0+(UCS2-LE encoded strings) the result as a String
throws:
  IOException - if an I/O error occurs



readString
String readString(int len, CharsetInfo info) throws IOException(Code)
Reads a String from the server response stream, creating it from a translated byte array.
Parameters:
  len - the length of the string to read in bytes
Parameters:
  info - descriptor of the charset to use the result as a String
throws:
  IOException - if an I/O error occurs



readUnicodeString
String readUnicodeString(int len) throws IOException(Code)
Reads a UCS2-LE (Unicode) encoded String object from the server response stream.
Parameters:
  len - the length of the string to read in characters the result as a String
throws:
  IOException - if an I/O error occurs



readUnsignedLong
BigDecimal readUnsignedLong() throws IOException(Code)
Reads an unsigned long value from the server response stream. the result as a BigDecimal
throws:
  IOException - if an I/O error occurs



skip
int skip(int skip) throws IOException(Code)
Discards bytes from the server response stream.
Parameters:
  skip - the number of bytes to discard the number of bytes skipped



skipString
void skipString(int len) throws IOException(Code)
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).
Parameters:
  len - the length of the string to skip in bytes in the caseof TDS 4.2/5.0 and in characters for TDS 7.0+(UCS2-LE encoded strings)
throws:
  IOException - if an I/O error occurs



skipToEnd
void skipToEnd()(Code)
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.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.