Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.crypto.asn1
Class ASN1ConstructedInputStream

`java.lang.Object
java.io.InputStream
java.io.FilterInputStream
oracle.security.crypto.asn1.ASN1ConstructedInputStream`

Direct Known Subclasses:
  ASN1SequenceInputStream, ASN1SetInputStream

public class ASN1ConstructedInputStream
extends java.io.FilterInputStream

A stream for reading one ASN.1 constructed encoding. Allows one-byte lookahead.

Field Summary

Fields inherited from class java.io.FilterInputStream
`in`

Constructor Summary
`ASN1ConstructedInputStream(java.io.InputStream is)` Creates a new `ASN1ConstructedInputStream` which will read from the specified input stream, which must be positioned just before the identifier octets of an ASN.1 encoding.
`ASN1ConstructedInputStream(java.io.InputStream is, ASN1Header header)` Creates a new `ASN1ConstructedInputStream` which will read from the specified input stream, which must be positioned just before the contents octets of an ASN.1 encoding.
`ASN1ConstructedInputStream(java.io.InputStream is, int tag)` Creates a new `ASN1ConstructedInputStream` which will read from the specified input stream, which must be positioned just before the identifier octets of an ASN.1 encoding.
`ASN1ConstructedInputStream(java.io.InputStream is, int tag, int tagClass)` Creates a new `ASN1ConstructedInputStream` which will read from the specified input stream, which must be positioned just before the identifier octets of an ASN.1 encoding.

Method Summary
`int` | `available()`
`int` | `getCurrentIDByte()` Returns the current tag ID (tag class, tag type...)
`int` | `getCurrentTag()` Returns the current tag.
`boolean` | `hasMoreData()` Returns `true` if the `ASN1Constructed` contained in this stream has not yet been completely read, otherwise `false`.
`boolean` | `markSupported()` Always returns `false`.
`int` | `read()` Reads one byte.
`int` | `read(byte[] b, int off, int len)`
`void` | `setCurrentTag(int tag)` Sets the current tag (and the current tag class to UNIVERSAL).
`void` | `terminate()` Invoking this method signals that all input from this constructed object has been read.
`void` | `terminate(boolean skipRemaining)` Invoking this method signals that all input from this constructed object has been read.
`void` | `unread(int ch)` Deprecated.

Methods inherited from class java.io.FilterInputStream
`close, mark, read, reset, skip`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ASN1ConstructedInputStream

    public ASN1ConstructedInputStream(java.io.InputStream is)
                               throws java.io.IOException

  Creates a new `ASN1ConstructedInputStream` which will read from the specified input stream, which must be positioned just before the identifier octets of an ASN.1 encoding.

  The encoding must have the context-specific tag class and the constructed bit set, otherwise an ASN.1 format exception is thrown.

  When this constructor returns, the underlying input stream will be positioned just before the contents octets of the encoding.

Parameters:
  `is` - the underlying input stream, positioned just before the initial (identifier) octets of an ASN.1 encoding
Throws:
  `ASN1FormatException` - if the wrong tag or tag class is encountered, or the encoding being read is not a constructed encoding
  `java.io.IOException`

### ASN1ConstructedInputStream

    public ASN1ConstructedInputStream(java.io.InputStream is,
                                      int tag)
                               throws java.io.IOException

  Creates a new `ASN1ConstructedInputStream` which will read from the specified input stream, which must be positioned just before the identifier octets of an ASN.1 encoding.

  The encoding must have the context-specific tag class and the specified tag value, otherwise an ASN.1 format exception is thrown.

  When this constructor returns, the underlying input stream will be positioned just before the contents octets of the encoding.

Parameters:
  `is` - the underlying input stream, positioned just before the initial (identifier) octets of an ASN.1 encoding
  `tag` - the expected tag
Throws:
  `ASN1FormatException` - if the wrong tag or tag class is encountered, or the encoding being read is not a constructed encoding
  `java.io.IOException`

### ASN1ConstructedInputStream

    public ASN1ConstructedInputStream(java.io.InputStream is,
                                      int tag,
                                      int tagClass)
                               throws java.io.IOException

  Creates a new `ASN1ConstructedInputStream` which will read from the specified input stream, which must be positioned just before the identifier octets of an ASN.1 encoding.

  The encoding must have the specified tag and tag class, otherwise an ASN.1 format exception is thrown.

  When this constructor returns, the underlying input stream will be positioned just before the contents octets of the encoding.

Parameters:
  `is` - the underlying input stream, positioned just before the initial (identifier) octets of an ASN.1 encoding
  `tag` - the expected tag
Throws:
  `ASN1FormatException` - if the wrong tag or tag class is encountered, or the encoding being read is not a constructed encoding
  `java.io.IOException`

### ASN1ConstructedInputStream

    public ASN1ConstructedInputStream(java.io.InputStream is,
                                      ASN1Header header)

  Creates a new `ASN1ConstructedInputStream` which will read from the specified input stream, which must be positioned just before the contents octets of an ASN.1 encoding.

  Unlike the other constructors of this class, this constructor does not reader the header from the underlying input stream; instead the header is specified as a parameter.

Method Detail

### read

    public int read()
             throws java.io.IOException

  Reads one byte.

  If end of stream is encountered, this method does not return -1; instead it throws an `ASN1FormatException`.

  Throws:
    `java.io.IOException`

### read

    public int read(byte[] b,
                    int off,
                    int len)
             throws java.io.IOException

  Throws:
    `java.io.IOException`

### available

    public int available()
                  throws java.io.IOException

  Throws:
    `java.io.IOException`

### markSupported

    public boolean markSupported()

  Always returns `false`.

### unread

    public void unread(int ch)

  Deprecated.
  Pushes the character into the pushback buffer.

  Note: The pushback buffer has only one byte of capacity.

  Parameters:
    `ch` - the `int` value whose low-order byte is to be pushed back

### hasMoreData

    public boolean hasMoreData()
                        throws java.io.IOException

  Returns `true` if the `ASN1Constructed` contained in this stream has not yet been completely read, otherwise `false`.
  Throws:
    `java.io.IOException`

### terminate

    public void terminate(boolean skipRemaining)
                   throws java.io.IOException

  Invoking this method signals that all input from this constructed object has been read.

  If the position of this stream is not at the end of the contents octets, then the `skipRemaining` parameter must be `true`.

  For an indefinite-length encoding, causes any end-of-contents bytes to be read.

  After calling this method, is an error to invoke any other method on this object except `close()`.

  It is an error to invoke this method if the pushback buffer is not empty.

  Parameters:
    `skipRemaining` - If the position of this stream is not at the end of the contents octets, then this must be `true`.
  Throws:
    `java.io.IOException`

### terminate

    public void terminate()
                   throws java.io.IOException

  Invoking this method signals that all input from this constructed object has been read. The position of this stream must be at the end of the contents octets.

  For an indefinite-length encoding, causes any end-of-contents bytes to be read.

  After calling this method, is an error to invoke any other method on this object except `close()`.

  It is an error to invoke this method if the pushback buffer is not empty.

  Throws:
    `java.io.IOException`

### getCurrentIDByte

    public int getCurrentIDByte()
                         throws java.io.IOException

  Returns the current tag ID (tag class, tag type...)
  Returns:
    the current tag or -1 if at end of body
  Throws:
    `java.io.IOException`

### getCurrentTag

    public int getCurrentTag()
                      throws java.io.IOException

  Returns the current tag.
  Returns:
    the current tag, if in the range 0..30; 31 if the current tag is outside that range; or -1 if at end of body
  Throws:
    `java.io.IOException`

### setCurrentTag

    public void setCurrentTag(int tag)
                       throws java.io.IOException

  Sets the current tag (and the current tag class to UNIVERSAL).
  Parameters:
    `tag` - the new tag value (must be in the range 0..30)
  Throws:
    `java.io.IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005, 2006 , Oracle. All rights reserved.