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


java.lang.Object
   org.apache.harmony.security.asn1.BerInputStream

All known Subclasses:   org.apache.harmony.security.asn1.DerInputStream,
BerInputStream
public class BerInputStream (Code)
Decodes ASN.1 types encoded with BER (X.690)
See Also:    http://asn1.elibel.tm.fr/en/standards/index.htm


Field Summary
final protected static  intINDEFINIT_LENGTH
    
protected  byte[]buffer
    
public  intchoiceIndex
    
public  Objectcontent
    
protected  intcontentOffset
    
protected  InputStreamin
    
protected  booleanisIndefinedLength
     Indicates defined or indefined reading mode for associated InputStream.
protected  booleanisVerify
     Indicates verify or store mode. In store mode a decoded content is stored in a newly allocated appropriate object.
protected  intlength
    
protected  intoffset
     The position in the buffer.
public  intoidElement
    
public  inttag
    
protected  inttagOffset
    
public  int[]times
    

Constructor Summary
public  BerInputStream(byte[] encoded)
     Creates stream for decoding.
public  BerInputStream(byte[] encoded, int offset, int expectedLength)
     Creates stream for decoding.
public  BerInputStream(InputStream in)
     Creates stream for decoding.
public  BerInputStream(InputStream in, int initialSize)
     Creates stream for decoding.

Method Summary
public  voidcompactBuffer()
    
public  Objectget(Object key)
    
final public  byte[]getBuffer()
    
final public  intgetContentOffset()
    
public  byte[]getEncoded()
     Returns encoded array.
final public  intgetEndOffset()
    
public static  intgetLength(byte[] encoding)
    
final public  intgetLength()
    
final public  intgetOffset()
    
final public  intgetTagOffset()
    
public  intnext()
     Decodes next encoded type.
public  voidput(Object key, Object entry)
    
protected  intread()
     Reads the next encoded byte from the encoded input stream.
public  voidreadBitString()
    
public  voidreadBoolean()
    
public  voidreadContent()
     Reads the next encoded content from the encoded input stream.
public  voidreadEnumerated()
    
public  voidreadGeneralizedTime()
    
public  voidreadInteger()
    
public  voidreadOID()
    
public  voidreadOctetString()
    
public  voidreadSequence(ASN1Sequence sequence)
    
public  voidreadSequenceOf(ASN1SequenceOf sequenceOf)
    
public  voidreadSet(ASN1Set set)
    
public  voidreadSetOf(ASN1SetOf setOf)
    
public  voidreadString(ASN1StringType type)
    
public  voidreadUTCTime()
    
final public  voidreset(byte[] encoded)
     Resets this stream to initial state.
final public  voidsetVerify()
     Sets verify mode.

Field Detail
INDEFINIT_LENGTH
final protected static int INDEFINIT_LENGTH(Code)
Indicates indefinite length of the current type



buffer
protected byte[] buffer(Code)
Internal buffer for storing encoded array



choiceIndex
public int choiceIndex(Code)
The last choice index



content
public Object content(Code)
Current decoded content



contentOffset
protected int contentOffset(Code)
Current decoded content offset



in
protected InputStream in(Code)
Associated InputStream



isIndefinedLength
protected boolean isIndefinedLength(Code)
Indicates defined or indefined reading mode for associated InputStream. This mode is defined by reading a length for a first ASN.1 type from InputStream.



isVerify
protected boolean isVerify(Code)
Indicates verify or store mode. In store mode a decoded content is stored in a newly allocated appropriate object. The content variable holds a reference to the last created object. In verify mode a decoded content is not stored.



length
protected int length(Code)
Current decoded length



offset
protected int offset(Code)
The position in the buffer. Next read must place data into the buffer from this offset



oidElement
public int oidElement(Code)



tag
public int tag(Code)
Current decoded tag



tagOffset
protected int tagOffset(Code)
Current decoded tag offset



times
public int[] times(Code)
Keeps last decoded: year, month, day, hour, minute, second, millisecond




Constructor Detail
BerInputStream
public BerInputStream(byte[] encoded) throws IOException(Code)
Creates stream for decoding.
Parameters:
  encoded - - bytes array to be decoded
throws:
  IOException - - if an error occurs



BerInputStream
public BerInputStream(byte[] encoded, int offset, int expectedLength) throws IOException(Code)
Creates stream for decoding.
Parameters:
  encoded - -bytes array to be decoded
Parameters:
  offset - -the encoding offset
Parameters:
  expectedLength - -expected length of full encoding, this includes identifier,length an content octets
throws:
  IOException - -if an error occurs



BerInputStream
public BerInputStream(InputStream in) throws IOException(Code)
Creates stream for decoding. Allocates initial buffer of default size
Parameters:
  is - associated InputStream



BerInputStream
public BerInputStream(InputStream in, int initialSize) throws IOException(Code)
Creates stream for decoding. Allocates initial buffer of initialSize size
Parameters:
  initialSize - the internal buffer initial size
Parameters:
  is - associated InputStream




Method Detail
compactBuffer
public void compactBuffer()(Code)
Reallocates the buffer in order to make it exactly the size of data it contains



get
public Object get(Object key)(Code)



getBuffer
final public byte[] getBuffer()(Code)
Returns internal buffer used for decoding - buffer



getContentOffset
final public int getContentOffset()(Code)



getEncoded
public byte[] getEncoded()(Code)
Returns encoded array. MUST be invoked after decoding corresponding ASN.1 notation



getEndOffset
final public int getEndOffset()(Code)
Returns end offset for the current encoded type - offset



getLength
public static int getLength(byte[] encoding)(Code)
Returns the length of the encoding



getLength
final public int getLength()(Code)
Returns length of the current content for decoding - length of content



getOffset
final public int getOffset()(Code)
Returns the current offset - offset



getTagOffset
final public int getTagOffset()(Code)
Returns start offset for the current encoded type - offset



next
public int next() throws IOException(Code)
Decodes next encoded type. Initializes tag, length, tagOffset and contentOffset variables next decoded tag
throws:
  IOException - - if error occured



put
public void put(Object key, Object entry)(Code)



read
protected int read() throws IOException(Code)
Reads the next encoded byte from the encoded input stream. the next encoded byte
throws:
  IOException - - if error occured



readBitString
public void readBitString() throws IOException(Code)
Decodes ASN.1 bitstring type
throws:
  IOException - - if error occured



readBoolean
public void readBoolean() throws IOException(Code)
Decodes ASN.1 boolean type
throws:
  IOException - - if error occured



readContent
public void readContent() throws IOException(Code)
Reads the next encoded content from the encoded input stream. The method MUST be used for reading a primitive encoded content.
throws:
  IOException - - if error occured



readEnumerated
public void readEnumerated() throws IOException(Code)
Decodes ASN.1 Enumerated type
throws:
  IOException - - if error occured



readGeneralizedTime
public void readGeneralizedTime() throws IOException(Code)
Decodes ASN.1 GeneralizedTime type
throws:
  IOException - - if error occured



readInteger
public void readInteger() throws IOException(Code)
Decodes ASN.1 Integer type
throws:
  IOException - - if error occured



readOID
public void readOID() throws IOException(Code)
Decodes ASN.1 ObjectIdentifier type
throws:
  IOException - - if error occured



readOctetString
public void readOctetString() throws IOException(Code)
Decodes ASN.1 Octetstring type
throws:
  IOException - - if error occured



readSequence
public void readSequence(ASN1Sequence sequence) throws IOException(Code)
Decodes ASN.1 Sequence type
Parameters:
  sequence - - ASN.1 sequence to be decoded
throws:
  IOException - - if error occured



readSequenceOf
public void readSequenceOf(ASN1SequenceOf sequenceOf) throws IOException(Code)
Decodes ASN.1 SequenceOf type
Parameters:
  sequenceOf - - ASN.1 sequence to be decoded
throws:
  IOException - - if error occured



readSet
public void readSet(ASN1Set set) throws IOException(Code)
Decodes ASN.1 Set type
Parameters:
  set - - ASN.1 set to be decoded
throws:
  IOException - - if error occured



readSetOf
public void readSetOf(ASN1SetOf setOf) throws IOException(Code)
Decodes ASN.1 SetOf type
Parameters:
  set - - ASN.1 set to be decoded
throws:
  IOException - - if error occured



readString
public void readString(ASN1StringType type) throws IOException(Code)
Decodes ASN.1 String type
throws:
  IOException - - if an I/O error occurs or the end of the stream is reached



readUTCTime
public void readUTCTime() throws IOException(Code)
Decodes ASN.1 UTCTime type
throws:
  IOException - - if an I/O error occurs or the end of the stream is reached



reset
final public void reset(byte[] encoded) throws IOException(Code)
Resets this stream to initial state.
Parameters:
  encoded - - a new bytes array to be decoded
throws:
  IOException - - if an error occurs



setVerify
final public void setVerify()(Code)
Sets verify mode.



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.