mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
06.45.2009 df426d8775737476ca79980ddc5a1b197f53207e
Add readStartSet and readEndSet methods to ASN1Reader for consistency with ASNWriter APIs. Also add writeStartSet(byte) method to ASN1Writer for consistency with sequence related methods.
7 files modified
117 ■■■■■ changed files
opends/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelReader.java 16 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelWriter.java 8 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1ByteSequenceReader.java 20 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1InputStreamReader.java 20 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1OutputStreamWriter.java 12 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java 24 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1Writer.java 17 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelReader.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.protocols.asn1;
@@ -392,6 +392,13 @@
  /**
   * {@inheritDoc}
   */
  public void readEndSet() throws ASN1Exception {
    reader.readEndSet();
  }
  /**
   * {@inheritDoc}
   */
  public long readInteger() throws ASN1Exception {
    return reader.readInteger();
  }
@@ -441,6 +448,13 @@
  /**
   * {@inheritDoc}
   */
  public void readStartSet() throws ASN1Exception {
    reader.readStartSet();
  }
  /**
   * {@inheritDoc}
   */
  public void close() throws IOException {
    reader.close();
    byteChannel.close();
opends/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelWriter.java
@@ -289,6 +289,14 @@
  }
  /**
   * {@inheritDoc}
   */
  public ASN1Writer writeStartSet(byte type) throws IOException {
    writer.writeStartSet(type);
    return this;
  }
  /**
   * Flush the entire contents of the NIO ByteBuffer out to the
   * channel.
   *
opends/src/server/org/opends/server/protocols/asn1/ASN1ByteSequenceReader.java
@@ -436,6 +436,16 @@
  /**
   * {@inheritDoc}
   */
  public void readStartSet() throws ASN1Exception
  {
    // From an implementation point of view, a set is equivalent to a
    // sequence.
    readStartSequence();
  }
  /**
   * {@inheritDoc}
   */
  public void readEndSequence() throws ASN1Exception
  {
    if(readerStack.isEmpty())
@@ -460,6 +470,16 @@
  /**
   * {@inheritDoc}
   */
  public void readEndSet() throws ASN1Exception
  {
    // From an implementation point of view, a set is equivalent to a
    // sequence.
    readEndSequence();
  }
  /**
   * {@inheritDoc}
   */
  public void skipElement() throws ASN1Exception
  {
    // Read the header if haven't done so already
opends/src/server/org/opends/server/protocols/asn1/ASN1InputStreamReader.java
@@ -728,6 +728,16 @@
  /**
   * {@inheritDoc}
   */
  public void readStartSet() throws ASN1Exception
  {
    // From an implementation point of view, a set is equivalent to a
    // sequence.
    readStartSequence();
  }
  /**
   * {@inheritDoc}
   */
  public void readEndSequence() throws ASN1Exception
  {
    if(streamStack.isEmpty())
@@ -755,6 +765,16 @@
  /**
   * {@inheritDoc}
   */
  public void readEndSet() throws ASN1Exception
  {
    // From an implementation point of view, a set is equivalent to a
    // sequence.
    readEndSequence();
  }
  /**
   * {@inheritDoc}
   */
  public void skipElement() throws ASN1Exception
  {
    // Read the header if haven't done so already
opends/src/server/org/opends/server/protocols/asn1/ASN1OutputStreamWriter.java
@@ -435,7 +435,17 @@
   */
  public ASN1Writer writeStartSet() throws IOException
  {
    return writeStartSequence(UNIVERSAL_SET_TYPE);
    return writeStartSet(UNIVERSAL_SET_TYPE);
  }
  /**
   * {@inheritDoc}
   */
  public ASN1Writer writeStartSet(byte type) throws IOException
  {
    // From an implementation point of view, a set is equivalent to a
    // sequence.
    return writeStartSequence(type);
  }
  /**
opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.protocols.asn1;
@@ -128,6 +128,17 @@
  /**
   * Finishes reading a set. Any elements not read in the set will be
   * discarded.
   *
   * @throws ASN1Exception
   *           If an error occurs while advancing to the end of the set.
   */
  void readEndSet() throws ASN1Exception;
  /**
   * Reads the next ASN.1 element as an integer and advances the
   * cursor.
   *
@@ -223,6 +234,17 @@
  /**
   * Reads the next ASN.1 element as a set. All further reads will read
   * the elements in the sequence until {@link #readEndSet()} is called.
   *
   * @throws ASN1Exception
   *           If the next element is not a set.
   */
  void readStartSet() throws ASN1Exception;
  /**
   * Advances this ASN.1 reader beyond the next ASN.1 element without
   * decoding it.
   *
opends/src/server/org/opends/server/protocols/asn1/ASN1Writer.java
@@ -335,7 +335,7 @@
  /**
   * Writes a sequence element using the provided type tag. All
   * further writes will be part of this set until
   * further writes will be part of this sequence until
   * {@link #writeEndSequence()} is called.
   *
   * @param type
@@ -358,4 +358,19 @@
   *           If an error occurs while writing.
   */
  ASN1Writer writeStartSet() throws IOException;
  /**
   * Writes a set element using the provided type tag. All further
   * writes will be part of this set until {@link #writeEndSet()} is
   * called.
   *
   * @param type
   *          The type tag to use.
   * @return a reference to this object.
   * @throws IOException
   *           If an error occurs while writing.
   */
  ASN1Writer writeStartSet(byte type) throws IOException;
}