public int encode(BerByteArrayOutputStream berOStream) throws IOException { for (int i = (identifier.length - 1); i >= 0; i--) { berOStream.write(identifier[i]); } return identifier.length; }
@Override public void write(int arg0) throws IOException { write((byte) arg0); }
public static int encodeLength(BerByteArrayOutputStream berOStream, int length) throws IOException { // the indefinite form is ignored for now if (length <= 127) { // this is the short form, it is coded differently than the long // form for values > 127 berOStream.write((byte) length); return 1; } else { int numLengthBytes = 1; while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) { numLengthBytes++; } for (int i = 0; i < numLengthBytes; i++) { berOStream.write((length >> 8 * i) & 0xff); } berOStream.write(0x80 | numLengthBytes); return 1 + numLengthBytes; } }
public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { berOStream.write(value); int codeLength = value.length; codeLength += BerLength.encodeLength(berOStream, codeLength); return codeLength; }
public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { int codeLength; if (code != null) { codeLength = code.length; for (int i = code.length - 1; i >= 0; i--) { berOStream.write(code[i]); } } else { for (int i = (bitString.length - 1); i >= 0; i--) { berOStream.write(bitString[i]); } berOStream.write(bitString.length * 8 - numBits); codeLength = bitString.length + 1; codeLength += BerLength.encodeLength(berOStream, codeLength); } if (explicit) { codeLength += id.encode(berOStream); } return codeLength; }
public int encode(BerByteArrayOutputStream os) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } return code.length; } int codeLength = 0; if (aeTitleForm2 != null) { codeLength += aeTitleForm2.encode(os, true); return codeLength; } throw new IOException("Error encoding BerChoice: No item in choice was selected."); }
public int encode(BerByteArrayOutputStream os) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } return code.length; } int codeLength = 0; if (aeQualifierForm2 != null) { codeLength += aeQualifierForm2.encode(os, true); return codeLength; } throw new IOException("Error encoding BerChoice: No item in choice was selected."); }
public int encode(BerByteArrayOutputStream os) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } return code.length; } int codeLength = 0; if (apTitleForm2 != null) { codeLength += apTitleForm2.encode(os, true); return codeLength; } throw new IOException("Error encoding BerChoice: No item in choice was selected."); }
public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { berOStream.write(octetString); int codeLength = octetString.length; codeLength += BerLength.encodeLength(berOStream, codeLength); if (explicit) { codeLength += id.encode(berOStream); } return codeLength; }
public int encode(BerByteArrayOutputStream berOStream, boolean explicit) throws IOException { berOStream.write(octetString); int codeLength = octetString.length; codeLength += BerLength.encodeLength(berOStream, codeLength); if (explicit) { codeLength += id.encode(berOStream); } return codeLength; }
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } if (withTag) { return tag.encode(os) + code.length; } return code.length; } int codeLength = 0; codeLength += transferSyntaxName.encode(os, false); // write tag: CONTEXT_CLASS, PRIMITIVE, 1 os.write(0x81); codeLength += 1; codeLength += abstractSyntaxName.encode(os, false); // write tag: CONTEXT_CLASS, PRIMITIVE, 0 os.write(0x80); codeLength += 1; codeLength += BerLength.encodeLength(os, codeLength); if (withTag) { codeLength += tag.encode(os); } return codeLength; }
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } if (withTag) { return tag.encode(os) + code.length; } return code.length; } int codeLength = 0; codeLength += modeValue.encode(os, false); // write tag: CONTEXT_CLASS, PRIMITIVE, 0 os.write(0x80); codeLength += 1; codeLength += BerLength.encodeLength(os, codeLength); if (withTag) { codeLength += tag.encode(os); } return codeLength; }
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } if (withTag) { return tag.encode(os) + code.length; } return code.length; } int codeLength = 0; for (int i = (seqOf.size() - 1); i >= 0; i--) { codeLength += seqOf.get(i).encode(os, true); } codeLength += BerLength.encodeLength(os, codeLength); if (withTag) { codeLength += tag.encode(os); } return codeLength; }
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } if (withTag) { return tag.encode(os) + code.length; } return code.length; } int codeLength = 0; for (int i = (seqOf.size() - 1); i >= 0; i--) { codeLength += seqOf.get(i).encode(os, true); } codeLength += BerLength.encodeLength(os, codeLength); if (withTag) { codeLength += tag.encode(os); } return codeLength; }
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } if (withTag) { return tag.encode(os) + code.length; } return code.length; } int codeLength = 0; for (int i = (seqOf.size() - 1); i >= 0; i--) { codeLength += seqOf.get(i).encode(os, true); } codeLength += BerLength.encodeLength(os, codeLength); if (withTag) { codeLength += tag.encode(os); } return codeLength; }
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } if (withTag) { return tag.encode(os) + code.length; } return code.length; } int codeLength = 0; for (int i = (seqOf.size() - 1); i >= 0; i--) { codeLength += seqOf.get(i).encode(os, true); } codeLength += BerLength.encodeLength(os, codeLength); if (withTag) { codeLength += tag.encode(os); } return codeLength; }
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } if (withTag) { return tag.encode(os) + code.length; } return code.length; } int codeLength = 0; for (int i = (seqOf.size() - 1); i >= 0; i--) { codeLength += seqOf.get(i).encode(os, true); } codeLength += BerLength.encodeLength(os, codeLength); if (withTag) { codeLength += tag.encode(os); } return codeLength; }
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } if (withTag) { return tag.encode(os) + code.length; } return code.length; } int codeLength = 0; for (int i = (seqOf.size() - 1); i >= 0; i--) { codeLength += seqOf.get(i).encode(os, true); } codeLength += BerLength.encodeLength(os, codeLength); if (withTag) { codeLength += tag.encode(os); } return codeLength; }
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } if (withTag) { return tag.encode(os) + code.length; } return code.length; } int codeLength = 0; codeLength += transferSyntaxNameList.encode(os, true); codeLength += abstractSyntaxName.encode(os, true); codeLength += presentationContextIdentifier.encode(os, true); codeLength += BerLength.encodeLength(os, codeLength); if (withTag) { codeLength += tag.encode(os); } return codeLength; }
public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException { if (code != null) { for (int i = code.length - 1; i >= 0; i--) { os.write(code[i]); } if (withTag) { return tag.encode(os) + code.length; } return code.length; } int codeLength = 0; codeLength += presentationDataValues.encode(os); codeLength += presentationContextIdentifier.encode(os, true); if (transferSyntaxName != null) { codeLength += transferSyntaxName.encode(os, true); } codeLength += BerLength.encodeLength(os, codeLength); if (withTag) { codeLength += tag.encode(os); } return codeLength; }