Tag { public int getTagSize() { return tagSize; } Tag(int tagNumber, byte tagClass, TagType tagType, int tagSize);  Tag(byte[] binary, int offset); int getTagNumber(); byte getTagClass(); TagType getTagType(); int getTagSize(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final byte UNIVERSAL; static final byte APPLICATION; static final byte CONTEXT; static final byte PRIVATE; }
@Test public void getSize() { Tag tag; tag = new Tag(0x15, Tag.UNIVERSAL, Tag.TagType.PRIMITIVE, 1); Assert.assertEquals(1, tag.getTagSize()); tag = new Tag(0x1E, Tag.UNIVERSAL, Tag.TagType.PRIMITIVE, 2); Assert.assertEquals(2, tag.getTagSize()); }