Java Doc for HandshakeIODataStream.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » xnet » provider » jsse » 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 » Apache Harmony Java SE » org package » org.apache.harmony.xnet.provider.jsse 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.harmony.xnet.provider.jsse.SSLInputStream
   org.apache.harmony.xnet.provider.jsse.HandshakeIODataStream

HandshakeIODataStream
public class HandshakeIODataStream extends SSLInputStream implements org.apache.harmony.xnet.provider.jsse.Appendable,DataStream(Code)
This class provides Input/Output data functionality for handshake layer. It provides read and write operations and accumulates all sent/received handshake's data. This class can be presented as a combination of 2 data pipes. The first data pipe is a pipe of income data: append method places the data at the beginning of the pipe, and read methods consume the data from the pipe. The second pipe is an outcoming data pipe: write operations plases the data into the pipe, and getData methods consume the data. It is important to note that work with pipe cound not be started if there is unconsumed data in another pipe. It is reasoned by the following: handshake protocol performs read and write operations consecuently. I.e. it first reads all income data and only than produces the responce and places it into the stream. The read operations of the stream presented by the methods of SSLInputStream which in its turn is an extension of InputStream. So this stream can be used as an InputStream parameter for certificate generation. Also input stream functionality supports marks. The marks help to reset the position of the stream in case of incompleate handshake records. Note that in case of exhausting of income data the EndOfBufferException is thown which implies the following: 1. the stream contains scrappy handshake record, 2. the read position should be reseted to marked, 3. and more income data is expected. The throwing of the exception (instead of returning of -1 value or incompleate filling of destination buffer) helps to speed up the process of scrappy data recognition and processing. For more information about TLS handshake process see TLS v 1 specification at http://www.ietf.org/rfc/rfc2246.txt.



Constructor Summary
public  HandshakeIODataStream()
    

Method Summary
public  voidappend(byte[] src)
     Appends the income data to be read by handshake protocol. The attempts to overflow the buffer by means of this methods seem to be futile because of: 1.
public  intavailable()
    
protected  voidclearBuffer()
    
public  byte[]getData(int length)
     returns the chunk of stored data with the length no more than specified.
protected  byte[]getDigestMD5()
    
protected  byte[]getDigestMD5withoutLast()
    
protected  byte[]getDigestSHA()
    
protected  byte[]getDigestSHAwithoutLast()
    
protected  byte[]getMessages()
    
public  booleanhasData()
    
public  voidmark(int limit)
    
public  voidmark()
    
public  booleanmarkSupported()
    
protected  voidprintContent(PrintStream outstream)
    
public  intread()
    
public  byte[]read(int length)
    
public  intread(byte[] dest, int offset, int length)
    
protected  voidremoveFromMarkedPosition()
     Removes the data from the marked position to the current read position.
public  voidreset()
    
public  voidwrite(byte b)
    
public  voidwrite(byte[] vector)
    
public  voidwriteUint16(long n)
    
public  voidwriteUint24(long n)
    
public  voidwriteUint32(long n)
    
public  voidwriteUint64(long n)
    
public  voidwriteUint8(long n)
    


Constructor Detail
HandshakeIODataStream
public HandshakeIODataStream()(Code)




Method Detail
append
public void append(byte[] src)(Code)
Appends the income data to be read by handshake protocol. The attempts to overflow the buffer by means of this methods seem to be futile because of: 1. The SSL protocol specifies the maximum size of the record and record protocol does not pass huge messages. (see TLS v1 specification http://www.ietf.org/rfc/rfc2246.txt , p 6.2) 2. After each call of this method, handshake protocol should start (and starts) the operations on received data and recognize the fake data if such was provided (to check the size of certificate for example).



available
public int available()(Code)



clearBuffer
protected void clearBuffer()(Code)



getData
public byte[] getData(int length)(Code)
returns the chunk of stored data with the length no more than specified. length: int



getDigestMD5
protected byte[] getDigestMD5()(Code)
Returns the MD5 digest of the data passed throught the stream MD5 digest



getDigestMD5withoutLast
protected byte[] getDigestMD5withoutLast()(Code)
Returns the MD5 digest of the data passed throught the stream except last message MD5 digest



getDigestSHA
protected byte[] getDigestSHA()(Code)
Returns the SHA-1 digest of the data passed throught the stream SHA-1 digest



getDigestSHAwithoutLast
protected byte[] getDigestSHAwithoutLast()(Code)
Returns the SHA-1 digest of the data passed throught the stream except last message SHA-1 digest



getMessages
protected byte[] getMessages()(Code)
Returns all the data passed throught the stream all the data passed throught the stream at the moment



hasData
public boolean hasData()(Code)



mark
public void mark(int limit)(Code)



mark
public void mark()(Code)



markSupported
public boolean markSupported()(Code)



printContent
protected void printContent(PrintStream outstream)(Code)



read
public int read() throws IOException(Code)
read an opaque value; byte: byte



read
public byte[] read(int length) throws IOException(Code)
reads vector of opaque values new: long



read
public int read(byte[] dest, int offset, int length) throws IOException(Code)



removeFromMarkedPosition
protected void removeFromMarkedPosition()(Code)
Removes the data from the marked position to the current read position. The method is usefull when it is needed to delete one message from the internal buffer.



reset
public void reset()(Code)



write
public void write(byte b)(Code)
Writes an opaque value byte: byte



write
public void write(byte[] vector)(Code)
writes vector of opaque values
Parameters:
  vector - the vector to be written



writeUint16
public void writeUint16(long n)(Code)
Writes Uint16 value long: the value to be written (last 2 bytes)



writeUint24
public void writeUint24(long n)(Code)
Writes Uint24 value long: the value to be written (last 3 bytes)



writeUint32
public void writeUint32(long n)(Code)
Writes Uint32 value long: the value to be written (last 4 bytes)



writeUint64
public void writeUint64(long n)(Code)
Writes Uint64 value long: the value to be written



writeUint8
public void writeUint8(long n)(Code)
Writes Uint8 value long: the value to be written (last byte)



Methods inherited from org.apache.harmony.xnet.provider.jsse.SSLInputStream
abstract public int available() throws IOException(Code)(Java Doc)
abstract public int read() throws IOException(Code)(Java Doc)
public byte[] read(int length) throws IOException(Code)(Java Doc)
public int read(byte[] b, int off, int len) throws IOException(Code)(Java Doc)
public int readUint16() throws IOException(Code)(Java Doc)
public int readUint24() throws IOException(Code)(Java Doc)
public long readUint32() throws IOException(Code)(Java Doc)
public long readUint64() throws IOException(Code)(Java Doc)
public int readUint8() throws IOException(Code)(Java Doc)
public long skip(long n) throws IOException(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.