Package com.hierynomus.asn1.types.string
Class ASN1BitString
- java.lang.Object
-
- com.hierynomus.asn1.types.ASN1Object<T>
-
- com.hierynomus.asn1.types.string.ASN1String<boolean[]>
-
- com.hierynomus.asn1.types.string.ASN1BitString
-
- All Implemented Interfaces:
ASN1Constructed
,ASN1Primitive
,java.lang.Iterable<ASN1Object>
public class ASN1BitString extends ASN1String<boolean[]>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ASN1BitString.Parser
static class
ASN1BitString.Serializer
-
Field Summary
Fields Modifier and Type Field Description private boolean[]
bits
private int
unusedBits
-
Fields inherited from class com.hierynomus.asn1.types.string.ASN1String
valueBytes
-
Fields inherited from class com.hierynomus.asn1.types.ASN1Object
tag
-
-
Constructor Summary
Constructors Modifier Constructor Description ASN1BitString(boolean[] bits)
ASN1BitString(byte[] bytes, int unusedBits)
private
ASN1BitString(ASN1Tag<ASN1BitString> tag, byte[] bytes, int unusedBits)
ASN1BitString(java.util.BitSet bitSet)
Constructor for ASN.1 BIT STRING.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean[]
constructBits()
private static byte[]
constructBytes(boolean[] bits)
private static byte[]
constructBytes(java.util.BitSet bitSet)
boolean[]
getValue()
boolean
isSet(int x)
Check whether bit 'x' is set in the ASN.1 BIT_STRINGint
length()
protected java.lang.String
valueString()
-
Methods inherited from class com.hierynomus.asn1.types.string.ASN1String
getValueBytes, iterator
-
Methods inherited from class com.hierynomus.asn1.types.ASN1Object
equals, getTag, hashCode, toString
-
-
-
-
Constructor Detail
-
ASN1BitString
private ASN1BitString(ASN1Tag<ASN1BitString> tag, byte[] bytes, int unusedBits)
-
ASN1BitString
public ASN1BitString(byte[] bytes, int unusedBits)
-
ASN1BitString
public ASN1BitString(boolean[] bits)
-
ASN1BitString
public ASN1BitString(java.util.BitSet bitSet)
Constructor for ASN.1 BIT STRING. The passed in BitSet will be treated as having no unused bits.- Parameters:
bitSet
-
-
-
Method Detail
-
constructBytes
private static byte[] constructBytes(boolean[] bits)
-
constructBytes
private static byte[] constructBytes(java.util.BitSet bitSet)
-
constructBits
private boolean[] constructBits()
-
getValue
public boolean[] getValue()
- Specified by:
getValue
in classASN1Object<boolean[]>
-
valueString
protected java.lang.String valueString()
- Overrides:
valueString
in classASN1Object<boolean[]>
-
isSet
public boolean isSet(int x)
Check whether bit 'x' is set in the ASN.1 BIT_STRING- Parameters:
x
- The bit to check- Returns:
true
if bit 'x' is set,false
otherwise.
-
length
public int length()
- Specified by:
length
in classASN1String<boolean[]>
-
-