@Override protected int getBodyLength() { if (bodyLength == -1) { try { bodyLength = encodingBodyLength(); } catch (IOException e) { throw new RuntimeException(e); } if (bodyLength == -1) { throw new RuntimeException("Unexpected body length: -1"); } } return bodyLength; }
@Override protected int getBodyLength() { if (bodyLength == -1) { try { bodyLength = encodingBodyLength(); } catch (IOException e) { throw new RuntimeException(e); } if (bodyLength == -1) { throw new RuntimeException("Unexpected body length: -1"); } } return bodyLength; }
@Override protected int encodingBodyLength() throws IOException { Asn1Encodeable value = (Asn1Encodeable) getValue(); if (isImplicit()) { return value.encodingBodyLength(); } else { return value.encodingLength(); } }
@Override protected int encodingBodyLength() throws IOException { Asn1Encodeable value = (Asn1Encodeable) getValue(); if (isImplicit()) { return value.encodingBodyLength(); } else { return value.encodingLength(); } }
@Override public void taggedEncode(ByteBuffer buffer, TaggingOption taggingOption) throws IOException { Tag taggingTag = taggingOption.getTag(!isPrimitive()); Asn1Util.encodeTag(buffer, taggingTag); int taggingBodyLen = taggingOption.isImplicit() ? encodingBodyLength() : encodingLength(); Asn1Util.encodeLength(buffer, taggingBodyLen); if (taggingOption.isImplicit()) { encodeBody(buffer); } else { encode(buffer); } }
@Override public void taggedEncode(ByteBuffer buffer, TaggingOption taggingOption) throws IOException { Tag taggingTag = taggingOption.getTag(!isPrimitive()); Asn1Util.encodeTag(buffer, taggingTag); int taggingBodyLen = taggingOption.isImplicit() ? encodingBodyLength() : encodingLength(); Asn1Util.encodeLength(buffer, taggingBodyLen); if (taggingOption.isImplicit()) { encodeBody(buffer); } else { encode(buffer); } }