@ -1,11 +1,11 @@
/** This class file was automatically generated by j ASN1 (http://www.beanit.com) */
/** This class file was automatically generated by ASN1bean (http://www.beanit.com) */
package com.beanit.openiec61850.internal.mms.asn1 ;
import com.beanit. j asn1.ber.BerLength;
import com.beanit. j asn1.ber.BerTag;
import com.beanit. j asn1.ber.ReverseByteArrayOutputStream;
import com.beanit. j asn1.ber.types.BerNull;
import com.beanit. j asn1.ber.types.BerType;
import com.beanit. asn1bean .ber.BerLength;
import com.beanit. asn1bean .ber.BerTag;
import com.beanit. asn1bean .ber.ReverseByteArrayOutputStream;
import com.beanit. asn1bean .ber.types.BerNull;
import com.beanit. asn1bean .ber.types.BerType;
import java.io.IOException ;
import java.io.InputStream ;
import java.io.OutputStream ;
@ -15,12 +15,11 @@ public class AlternateAccessSelection implements BerType, Serializable {
private static final long serialVersionUID = 1L ;
p ublic byte [ ] code = null ;
p rivate byte [ ] code = null ;
private SelectAlternateAccess selectAlternateAccess = null ;
private SelectAccess selectAccess = null ;
public AlternateAccessSelection ( ) { }
public AlternateAccessSelection ( byte [ ] code ) {
this . code = code ;
}
@ -41,12 +40,11 @@ public class AlternateAccessSelection implements BerType, Serializable {
this . selectAccess = selectAccess ;
}
@Override
public int encode ( OutputStream reverseOS ) throws IOException {
if ( code ! = null ) {
for ( int i = code . length - 1 ; i > = 0 ; i - - ) {
reverseOS . write ( code [ i ] ) ;
}
reverseOS . write ( code ) ;
return code . length ;
}
@ -67,35 +65,38 @@ public class AlternateAccessSelection implements BerType, Serializable {
throw new IOException ( "Error encoding CHOICE: No element of CHOICE was selected." ) ;
}
@Override
public int decode ( InputStream is ) throws IOException {
return decode ( is , null ) ;
}
public int decode ( InputStream is , BerTag berTag ) throws IOException {
int codeLength = 0 ;
BerTag passedTag = berTag ;
int tlvByteCount = 0 ;
boolean tagWasPassed = ( berTag ! = null ) ;
if ( berTag = = null ) {
berTag = new BerTag ( ) ;
codeLength + = berTag . decode ( is ) ;
tlvByteCount + = berTag . decode ( is ) ;
}
int numDecodedBytes ;
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . CONSTRUCTED , 0 ) ) {
selectAlternateAccess = new SelectAlternateAccess ( ) ;
codeLength + = selectAlternateAccess . decode ( is , false ) ;
return codeLength ;
tlvByteCount + = selectAlternateAccess . decode ( is , false ) ;
return tlvByteCount ;
}
selectAccess = new SelectAccess ( ) ;
int choiceDecodeLength = selectAccess . decode ( is , berTag ) ;
if ( choiceDecodeLength ! = 0 ) {
return codeLength + choiceDecodeLength ;
numDecodedBytes = selectAccess . decode ( is , berTag ) ;
if ( numDecodedBytes ! = 0 ) {
return tlvByteCount + numDecodedBytes ;
} else {
selectAccess = null ;
}
if ( passedTag ! = null ) {
if ( tagWasPassed ) {
return 0 ;
}
@ -108,6 +109,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
code = reverseOS . getArray ( ) ;
}
@Override
public String toString ( ) {
StringBuilder sb = new StringBuilder ( ) ;
appendAsString ( sb , 0 ) ;
@ -135,10 +137,9 @@ public class AlternateAccessSelection implements BerType, Serializable {
public static final BerTag tag = new BerTag ( BerTag . UNIVERSAL_CLASS , BerTag . CONSTRUCTED , 16 ) ;
private static final long serialVersionUID = 1L ;
p ublic byte [ ] code = null ;
p rivate byte [ ] code = null ;
private AccessSelection accessSelection = null ;
private AlternateAccess alternateAccess = null ;
public SelectAlternateAccess ( ) { }
public SelectAlternateAccess ( byte [ ] code ) {
@ -161,6 +162,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
this . alternateAccess = alternateAccess ;
}
@Override
public int encode ( OutputStream reverseOS ) throws IOException {
return encode ( reverseOS , true ) ;
}
@ -168,9 +170,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
public int encode ( OutputStream reverseOS , boolean withTag ) throws IOException {
if ( code ! = null ) {
for ( int i = code . length - 1 ; i > = 0 ; i - - ) {
reverseOS . write ( code [ i ] ) ;
}
reverseOS . write ( code ) ;
if ( withTag ) {
return tag . encode ( reverseOS ) + code . length ;
}
@ -191,42 +191,58 @@ public class AlternateAccessSelection implements BerType, Serializable {
return codeLength ;
}
@Override
public int decode ( InputStream is ) throws IOException {
return decode ( is , true ) ;
}
public int decode ( InputStream is , boolean withTag ) throws IOException {
int codeLength = 0 ;
int subCodeLength = 0 ;
int tlByteCount = 0 ;
int vByteCount = 0 ;
int numDecodedBytes ;
BerTag berTag = new BerTag ( ) ;
if ( withTag ) {
codeLength + = tag . decodeAndCheck ( is ) ;
tlByteCount + = tag . decodeAndCheck ( is ) ;
}
BerLength length = new BerLength ( ) ;
codeLength + = length . decode ( is ) ;
tlByteCount + = length . decode ( is ) ;
int lengthVal = length . val ;
vByteCount + = berTag . decode ( is ) ;
int totalLength = length . val ;
codeLength + = totalLength ;
subCodeLength + = berTag . decode ( is ) ;
accessSelection = new AccessSelection ( ) ;
subCodeLength + = accessSelection . decode ( is , berTag ) ;
subCodeLength + = berTag . decode ( is ) ;
numDecodedBytes = accessSelection . decode ( is , berTag ) ;
if ( numDecodedBytes ! = 0 ) {
vByteCount + = numDecodedBytes ;
vByteCount + = berTag . decode ( is ) ;
} else {
throw new IOException ( "Tag does not match mandatory sequence component." ) ;
}
if ( berTag . equals ( AlternateAccess . tag ) ) {
alternateAccess = new AlternateAccess ( ) ;
subCodeLength + = alternateAccess . decode ( is , false ) ;
if ( subCodeLength = = totalLength ) {
return codeLength ;
vByteCount + = alternateAccess . decode ( is , false ) ;
if ( lengthVal > = 0 & & vByteCount = = lengthVal ) {
return tlByteCount + vByteCount ;
}
vByteCount + = berTag . decode ( is ) ;
} else {
throw new IOException ( "Tag does not match mandatory sequence component." ) ;
}
if ( lengthVal < 0 ) {
if ( ! berTag . equals ( 0 , 0 , 0 ) ) {
throw new IOException ( "Decoded sequence has wrong end of contents octets" ) ;
}
vByteCount + = BerLength . readEocByte ( is ) ;
return tlByteCount + vByteCount ;
}
throw new IOException (
"Unexpected end of sequence, length tag: "
+ totalLength
+ ", actual sequence length: "
+ subCodeLength ) ;
+ lengthVal
+ ", bytes decoded : "
+ vByteCount ) ;
}
public void encodeAndSave ( int encodingSizeGuess ) throws IOException {
@ -235,6 +251,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
code = reverseOS . getArray ( ) ;
}
@Override
public String toString ( ) {
StringBuilder sb = new StringBuilder ( ) ;
appendAsString ( sb , 0 ) ;
@ -277,14 +294,12 @@ public class AlternateAccessSelection implements BerType, Serializable {
private static final long serialVersionUID = 1L ;
p ublic byte [ ] code = null ;
p rivate byte [ ] code = null ;
private Component component = null ;
private Unsigned32 index = null ;
private IndexRange indexRange = null ;
private BerNull allElements = null ;
public AccessSelection ( ) { }
public AccessSelection ( byte [ ] code ) {
this . code = code ;
}
@ -321,12 +336,11 @@ public class AlternateAccessSelection implements BerType, Serializable {
this . allElements = allElements ;
}
@Override
public int encode ( OutputStream reverseOS ) throws IOException {
if ( code ! = null ) {
for ( int i = code . length - 1 ; i > = 0 ; i - - ) {
reverseOS . write ( code [ i ] ) ;
}
reverseOS . write ( code ) ;
return code . length ;
}
@ -370,46 +384,49 @@ public class AlternateAccessSelection implements BerType, Serializable {
throw new IOException ( "Error encoding CHOICE: No element of CHOICE was selected." ) ;
}
@Override
public int decode ( InputStream is ) throws IOException {
return decode ( is , null ) ;
}
public int decode ( InputStream is , BerTag berTag ) throws IOException {
int codeLength = 0 ;
BerTag passedTag = berTag ;
int tlvByteCount = 0 ;
boolean tagWasPassed = ( berTag ! = null ) ;
if ( berTag = = null ) {
berTag = new BerTag ( ) ;
codeLength + = berTag . decode ( is ) ;
tlvByteCount + = berTag . decode ( is ) ;
}
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . CONSTRUCTED , 0 ) ) {
codeLength + = BerLength . skip ( is ) ;
BerLength explicitTagLength = new BerLength ( ) ;
tlvByteCount + = explicitTagLength . decode ( is ) ;
component = new Component ( ) ;
codeLength + = component . decode ( is , null ) ;
return codeLength ;
tlvByteCount + = component . decode ( is , null ) ;
tlvByteCount + = explicitTagLength . readEocIfIndefinite ( is ) ;
return tlvByteCount ;
}
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . PRIMITIVE , 1 ) ) {
index = new Unsigned32 ( ) ;
codeLength + = index . decode ( is , false ) ;
return codeLength ;
tlvByteCount + = index . decode ( is , false ) ;
return tlvByteCount ;
}
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . CONSTRUCTED , 2 ) ) {
indexRange = new IndexRange ( ) ;
codeLength + = indexRange . decode ( is , false ) ;
return codeLength ;
tlvByteCount + = indexRange . decode ( is , false ) ;
return tlvByteCount ;
}
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . PRIMITIVE , 3 ) ) {
allElements = new BerNull ( ) ;
codeLength + = allElements . decode ( is , false ) ;
return codeLength ;
tlvByteCount + = allElements . decode ( is , false ) ;
return tlvByteCount ;
}
if ( passedTag ! = null ) {
if ( tagWasPassed ) {
return 0 ;
}
@ -423,6 +440,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
code = reverseOS . getArray ( ) ;
}
@Override
public String toString ( ) {
StringBuilder sb = new StringBuilder ( ) ;
appendAsString ( sb , 0 ) ;
@ -460,7 +478,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
private static final long serialVersionUID = 1L ;
p ublic byte [ ] code = null ;
p rivate byte [ ] code = null ;
private BasicIdentifier basic = null ;
public Component ( ) { }
@ -477,12 +495,11 @@ public class AlternateAccessSelection implements BerType, Serializable {
this . basic = basic ;
}
@Override
public int encode ( OutputStream reverseOS ) throws IOException {
if ( code ! = null ) {
for ( int i = code . length - 1 ; i > = 0 ; i - - ) {
reverseOS . write ( code [ i ] ) ;
}
reverseOS . write ( code ) ;
return code . length ;
}
@ -495,27 +512,28 @@ public class AlternateAccessSelection implements BerType, Serializable {
throw new IOException ( "Error encoding CHOICE: No element of CHOICE was selected." ) ;
}
@Override
public int decode ( InputStream is ) throws IOException {
return decode ( is , null ) ;
}
public int decode ( InputStream is , BerTag berTag ) throws IOException {
int codeLength = 0 ;
BerTag passedTag = berTag ;
int tlvByteCount = 0 ;
boolean tagWasPassed = ( berTag ! = null ) ;
if ( berTag = = null ) {
berTag = new BerTag ( ) ;
codeLength + = berTag . decode ( is ) ;
tlvByteCount + = berTag . decode ( is ) ;
}
if ( berTag . equals ( BasicIdentifier . tag ) ) {
basic = new BasicIdentifier ( ) ;
codeLength + = basic . decode ( is , false ) ;
return codeLength ;
tlvByteCount + = basic . decode ( is , false ) ;
return tlvByteCount ;
}
if ( passedTag ! = null ) {
if ( tagWasPassed ) {
return 0 ;
}
@ -529,6 +547,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
code = reverseOS . getArray ( ) ;
}
@Override
public String toString ( ) {
StringBuilder sb = new StringBuilder ( ) ;
appendAsString ( sb , 0 ) ;
@ -550,7 +569,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
public static final BerTag tag = new BerTag ( BerTag . UNIVERSAL_CLASS , BerTag . CONSTRUCTED , 16 ) ;
private static final long serialVersionUID = 1L ;
p ublic byte [ ] code = null ;
p rivate byte [ ] code = null ;
private Unsigned32 lowIndex = null ;
private Unsigned32 numberOfElements = null ;
@ -576,6 +595,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
this . numberOfElements = numberOfElements ;
}
@Override
public int encode ( OutputStream reverseOS ) throws IOException {
return encode ( reverseOS , true ) ;
}
@ -583,9 +603,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
public int encode ( OutputStream reverseOS , boolean withTag ) throws IOException {
if ( code ! = null ) {
for ( int i = code . length - 1 ; i > = 0 ; i - - ) {
reverseOS . write ( code [ i ] ) ;
}
reverseOS . write ( code ) ;
if ( withTag ) {
return tag . encode ( reverseOS ) + code . length ;
}
@ -612,46 +630,57 @@ public class AlternateAccessSelection implements BerType, Serializable {
return codeLength ;
}
@Override
public int decode ( InputStream is ) throws IOException {
return decode ( is , true ) ;
}
public int decode ( InputStream is , boolean withTag ) throws IOException {
int codeLength = 0 ;
int subCodeLength = 0 ;
int tlByteCount = 0 ;
int vByteCount = 0 ;
BerTag berTag = new BerTag ( ) ;
if ( withTag ) {
codeLength + = tag . decodeAndCheck ( is ) ;
tlByteCount + = tag . decodeAndCheck ( is ) ;
}
BerLength length = new BerLength ( ) ;
codeLength + = length . decode ( is ) ;
tlByteCount + = length . decode ( is ) ;
int lengthVal = length . val ;
vByteCount + = berTag . decode ( is ) ;
int totalLength = length . val ;
codeLength + = totalLength ;
subCodeLength + = berTag . decode ( is ) ;
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . PRIMITIVE , 0 ) ) {
lowIndex = new Unsigned32 ( ) ;
subCodeLength + = lowIndex . decode ( is , false ) ;
subCodeLength + = berTag . decode ( is ) ;
vByteCount + = lowIndex . decode ( is , false ) ;
vByteCount + = berTag . decode ( is ) ;
} else {
throw new IOException ( "Tag does not match the mandatory sequence element tag .") ;
throw new IOException ( "Tag does not match mandatory sequence component .") ;
}
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . PRIMITIVE , 1 ) ) {
numberOfElements = new Unsigned32 ( ) ;
subCodeLength + = numberOfElements . decode ( is , false ) ;
if ( subCodeLength = = totalLength ) {
return codeLength ;
vByteCount + = numberOfElements . decode ( is , false ) ;
if ( lengthVal > = 0 & & vByteCount = = lengthVal ) {
return tlByteCount + vByteCount ;
}
vByteCount + = berTag . decode ( is ) ;
} else {
throw new IOException ( "Tag does not match mandatory sequence component." ) ;
}
if ( lengthVal < 0 ) {
if ( ! berTag . equals ( 0 , 0 , 0 ) ) {
throw new IOException ( "Decoded sequence has wrong end of contents octets" ) ;
}
vByteCount + = BerLength . readEocByte ( is ) ;
return tlByteCount + vByteCount ;
}
throw new IOException (
"Unexpected end of sequence, length tag: "
+ totalLength
+ ", actual sequence length: "
+ subCodeLength ) ;
+ lengthVal
+ ", bytes decoded : "
+ vByteCount ) ;
}
public void encodeAndSave ( int encodingSizeGuess ) throws IOException {
@ -661,6 +690,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
code = reverseOS . getArray ( ) ;
}
@Override
public String toString ( ) {
StringBuilder sb = new StringBuilder ( ) ;
appendAsString ( sb , 0 ) ;
@ -704,14 +734,12 @@ public class AlternateAccessSelection implements BerType, Serializable {
private static final long serialVersionUID = 1L ;
p ublic byte [ ] code = null ;
p rivate byte [ ] code = null ;
private Component component = null ;
private Unsigned32 index = null ;
private IndexRange indexRange = null ;
private BerNull allElements = null ;
public SelectAccess ( ) { }
public SelectAccess ( byte [ ] code ) {
this . code = code ;
}
@ -748,12 +776,11 @@ public class AlternateAccessSelection implements BerType, Serializable {
this . allElements = allElements ;
}
@Override
public int encode ( OutputStream reverseOS ) throws IOException {
if ( code ! = null ) {
for ( int i = code . length - 1 ; i > = 0 ; i - - ) {
reverseOS . write ( code [ i ] ) ;
}
reverseOS . write ( code ) ;
return code . length ;
}
@ -797,46 +824,49 @@ public class AlternateAccessSelection implements BerType, Serializable {
throw new IOException ( "Error encoding CHOICE: No element of CHOICE was selected." ) ;
}
@Override
public int decode ( InputStream is ) throws IOException {
return decode ( is , null ) ;
}
public int decode ( InputStream is , BerTag berTag ) throws IOException {
int codeLength = 0 ;
BerTag passedTag = berTag ;
int tlvByteCount = 0 ;
boolean tagWasPassed = ( berTag ! = null ) ;
if ( berTag = = null ) {
berTag = new BerTag ( ) ;
codeLength + = berTag . decode ( is ) ;
tlvByteCount + = berTag . decode ( is ) ;
}
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . CONSTRUCTED , 1 ) ) {
codeLength + = BerLength . skip ( is ) ;
BerLength explicitTagLength = new BerLength ( ) ;
tlvByteCount + = explicitTagLength . decode ( is ) ;
component = new Component ( ) ;
codeLength + = component . decode ( is , null ) ;
return codeLength ;
tlvByteCount + = component . decode ( is , null ) ;
tlvByteCount + = explicitTagLength . readEocIfIndefinite ( is ) ;
return tlvByteCount ;
}
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . PRIMITIVE , 2 ) ) {
index = new Unsigned32 ( ) ;
codeLength + = index . decode ( is , false ) ;
return codeLength ;
tlvByteCount + = index . decode ( is , false ) ;
return tlvByteCount ;
}
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . CONSTRUCTED , 3 ) ) {
indexRange = new IndexRange ( ) ;
codeLength + = indexRange . decode ( is , false ) ;
return codeLength ;
tlvByteCount + = indexRange . decode ( is , false ) ;
return tlvByteCount ;
}
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . PRIMITIVE , 4 ) ) {
allElements = new BerNull ( ) ;
codeLength + = allElements . decode ( is , false ) ;
return codeLength ;
tlvByteCount + = allElements . decode ( is , false ) ;
return tlvByteCount ;
}
if ( passedTag ! = null ) {
if ( tagWasPassed ) {
return 0 ;
}
@ -849,6 +879,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
code = reverseOS . getArray ( ) ;
}
@Override
public String toString ( ) {
StringBuilder sb = new StringBuilder ( ) ;
appendAsString ( sb , 0 ) ;
@ -886,7 +917,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
private static final long serialVersionUID = 1L ;
p ublic byte [ ] code = null ;
p rivate byte [ ] code = null ;
private BasicIdentifier basic = null ;
public Component ( ) { }
@ -903,12 +934,11 @@ public class AlternateAccessSelection implements BerType, Serializable {
this . basic = basic ;
}
@Override
public int encode ( OutputStream reverseOS ) throws IOException {
if ( code ! = null ) {
for ( int i = code . length - 1 ; i > = 0 ; i - - ) {
reverseOS . write ( code [ i ] ) ;
}
reverseOS . write ( code ) ;
return code . length ;
}
@ -921,27 +951,28 @@ public class AlternateAccessSelection implements BerType, Serializable {
throw new IOException ( "Error encoding CHOICE: No element of CHOICE was selected." ) ;
}
@Override
public int decode ( InputStream is ) throws IOException {
return decode ( is , null ) ;
}
public int decode ( InputStream is , BerTag berTag ) throws IOException {
int codeLength = 0 ;
BerTag passedTag = berTag ;
int tlvByteCount = 0 ;
boolean tagWasPassed = ( berTag ! = null ) ;
if ( berTag = = null ) {
berTag = new BerTag ( ) ;
codeLength + = berTag . decode ( is ) ;
tlvByteCount + = berTag . decode ( is ) ;
}
if ( berTag . equals ( BasicIdentifier . tag ) ) {
basic = new BasicIdentifier ( ) ;
codeLength + = basic . decode ( is , false ) ;
return codeLength ;
tlvByteCount + = basic . decode ( is , false ) ;
return tlvByteCount ;
}
if ( passedTag ! = null ) {
if ( tagWasPassed ) {
return 0 ;
}
@ -955,6 +986,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
code = reverseOS . getArray ( ) ;
}
@Override
public String toString ( ) {
StringBuilder sb = new StringBuilder ( ) ;
appendAsString ( sb , 0 ) ;
@ -976,7 +1008,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
public static final BerTag tag = new BerTag ( BerTag . UNIVERSAL_CLASS , BerTag . CONSTRUCTED , 16 ) ;
private static final long serialVersionUID = 1L ;
p ublic byte [ ] code = null ;
p rivate byte [ ] code = null ;
private Unsigned32 lowIndex = null ;
private Unsigned32 numberOfElements = null ;
@ -1002,6 +1034,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
this . numberOfElements = numberOfElements ;
}
@Override
public int encode ( OutputStream reverseOS ) throws IOException {
return encode ( reverseOS , true ) ;
}
@ -1009,9 +1042,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
public int encode ( OutputStream reverseOS , boolean withTag ) throws IOException {
if ( code ! = null ) {
for ( int i = code . length - 1 ; i > = 0 ; i - - ) {
reverseOS . write ( code [ i ] ) ;
}
reverseOS . write ( code ) ;
if ( withTag ) {
return tag . encode ( reverseOS ) + code . length ;
}
@ -1038,46 +1069,57 @@ public class AlternateAccessSelection implements BerType, Serializable {
return codeLength ;
}
@Override
public int decode ( InputStream is ) throws IOException {
return decode ( is , true ) ;
}
public int decode ( InputStream is , boolean withTag ) throws IOException {
int codeLength = 0 ;
int subCodeLength = 0 ;
int tlByteCount = 0 ;
int vByteCount = 0 ;
BerTag berTag = new BerTag ( ) ;
if ( withTag ) {
codeLength + = tag . decodeAndCheck ( is ) ;
tlByteCount + = tag . decodeAndCheck ( is ) ;
}
BerLength length = new BerLength ( ) ;
codeLength + = length . decode ( is ) ;
tlByteCount + = length . decode ( is ) ;
int lengthVal = length . val ;
vByteCount + = berTag . decode ( is ) ;
int totalLength = length . val ;
codeLength + = totalLength ;
subCodeLength + = berTag . decode ( is ) ;
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . PRIMITIVE , 0 ) ) {
lowIndex = new Unsigned32 ( ) ;
subCodeLength + = lowIndex . decode ( is , false ) ;
subCodeLength + = berTag . decode ( is ) ;
vByteCount + = lowIndex . decode ( is , false ) ;
vByteCount + = berTag . decode ( is ) ;
} else {
throw new IOException ( "Tag does not match the mandatory sequence element tag .") ;
throw new IOException ( "Tag does not match mandatory sequence component .") ;
}
if ( berTag . equals ( BerTag . CONTEXT_CLASS , BerTag . PRIMITIVE , 1 ) ) {
numberOfElements = new Unsigned32 ( ) ;
subCodeLength + = numberOfElements . decode ( is , false ) ;
if ( subCodeLength = = totalLength ) {
return codeLength ;
vByteCount + = numberOfElements . decode ( is , false ) ;
if ( lengthVal > = 0 & & vByteCount = = lengthVal ) {
return tlByteCount + vByteCount ;
}
vByteCount + = berTag . decode ( is ) ;
} else {
throw new IOException ( "Tag does not match mandatory sequence component." ) ;
}
if ( lengthVal < 0 ) {
if ( ! berTag . equals ( 0 , 0 , 0 ) ) {
throw new IOException ( "Decoded sequence has wrong end of contents octets" ) ;
}
vByteCount + = BerLength . readEocByte ( is ) ;
return tlByteCount + vByteCount ;
}
throw new IOException (
"Unexpected end of sequence, length tag: "
+ totalLength
+ ", actual sequence length: "
+ subCodeLength ) ;
+ lengthVal
+ ", bytes decoded : "
+ vByteCount ) ;
}
public void encodeAndSave ( int encodingSizeGuess ) throws IOException {
@ -1087,6 +1129,7 @@ public class AlternateAccessSelection implements BerType, Serializable {
code = reverseOS . getArray ( ) ;
}
@Override
public String toString ( ) {
StringBuilder sb = new StringBuilder ( ) ;
appendAsString ( sb , 0 ) ;