pasn.encoding.ber
Class BEROutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by pasn.encoding.ASN1OutputStream
              extended by pasn.misc.encoding.TLV_OutputStream
                  extended by pasn.encoding.ber.BEROutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class BEROutputStream
extends TLV_OutputStream

Author:
ncottin

Field Summary
static java.lang.String id
           
 
Fields inherited from class pasn.misc.encoding.TLV_OutputStream
INDEFINITE_LENGTH_END
 
Constructor Summary
BEROutputStream()
           
BEROutputStream(java.io.OutputStream out)
           Creates a definite length BER producer
BEROutputStream(java.io.OutputStream out, boolean indefiniteLength)
           Creates a definite or indefinite length BER producer
BEROutputStream(java.io.OutputStream out, int maxPrimitiveSize)
           
 
Method Summary
 void encode(ASN1PrimitiveOrConstructedObject asn, boolean optional)
           
 java.lang.String getIdentifier()
           
 int getMaximumPrimitiveSize()
           
 boolean hasMaximumPrimitiveSize()
           
 boolean isConstructedIndefiniteLength()
           
 boolean isOrdered()
           BER do not take SET and SET OF inner elements ordering into account
 boolean isPrimitiveIndefiniteLength()
           
 ASN1OutputStream newInstance(java.io.OutputStream out)
           
 void setIndefiniteLength(boolean indefiniteLength)
           
 void setMaximumPrimitiveSize(int maxPrimitiveSize)
           
 void sort(ASN1ConstructedObject asn, java.util.LinkedList<ASN1IndexedEncodedValue> encodedValues)
           
 
Methods inherited from class pasn.misc.encoding.TLV_OutputStream
encode, encode, encode, encode, encode, isIndefiniteLength, writeTag, writeType, writeTypeOrTag
 
Methods inherited from class pasn.encoding.ASN1OutputStream
encode, encode, encode, encode, encode, getEncoder, isIdentified
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public static final java.lang.String id
See Also:
Constant Field Values
Constructor Detail

BEROutputStream

public BEROutputStream()

BEROutputStream

public BEROutputStream(java.io.OutputStream out)

Creates a definite length BER producer

Parameters:
out -

BEROutputStream

public BEROutputStream(java.io.OutputStream out,
                       boolean indefiniteLength)

Creates a definite or indefinite length BER producer

Parameters:
out -
indefiniteLength - Sets indefinite length encoding

BEROutputStream

public BEROutputStream(java.io.OutputStream out,
                       int maxPrimitiveSize)
Method Detail

getIdentifier

public final java.lang.String getIdentifier()
Specified by:
getIdentifier in class ASN1OutputStream

isPrimitiveIndefiniteLength

public final boolean isPrimitiveIndefiniteLength()
Specified by:
isPrimitiveIndefiniteLength in class TLV_OutputStream
Returns:
True if indefinite length specified, false if definite length encoding applies

isConstructedIndefiniteLength

public final boolean isConstructedIndefiniteLength()
Specified by:
isConstructedIndefiniteLength in class TLV_OutputStream
Returns:
True if indefinite length specified, false if definite length encoding applies

getMaximumPrimitiveSize

public final int getMaximumPrimitiveSize()
Specified by:
getMaximumPrimitiveSize in class TLV_OutputStream

setMaximumPrimitiveSize

public final void setMaximumPrimitiveSize(int maxPrimitiveSize)

hasMaximumPrimitiveSize

public final boolean hasMaximumPrimitiveSize()

encode

public final void encode(ASN1PrimitiveOrConstructedObject asn,
                         boolean optional)
                  throws java.io.IOException,
                         ASN1EncodingException
Specified by:
encode in class ASN1OutputStream
Throws:
java.io.IOException
ASN1EncodingException

isOrdered

public final boolean isOrdered()

BER do not take SET and SET OF inner elements ordering into account

Specified by:
isOrdered in class TLV_OutputStream
Returns:
False

sort

public final void sort(ASN1ConstructedObject asn,
                       java.util.LinkedList<ASN1IndexedEncodedValue> encodedValues)
                throws java.io.IOException,
                       ASN1EncodingException
Specified by:
sort in class TLV_OutputStream
Throws:
java.io.IOException
ASN1EncodingException

setIndefiniteLength

public final void setIndefiniteLength(boolean indefiniteLength)
Parameters:
indefiniteLength - the indefiniteLength to set

newInstance

public ASN1OutputStream newInstance(java.io.OutputStream out)
Specified by:
newInstance in class ASN1OutputStream