jp.bitmeister.asn1.value
Class BinString

java.lang.Object
  extended by jp.bitmeister.asn1.value.BinString
All Implemented Interfaces:
StringItem

public class BinString
extends java.lang.Object
implements StringItem

Represents ASN.1 'Binaly string(bString)' item.

An instance of this class represents a 'bString' item.

Author:
WATANABE, Jun.

Constructor Summary
BinString(boolean... array)
          Instantiates a BinString and initialize it with an array of boolean.
BinString(java.lang.String string)
          Instantiates a BinString and initialize it with a String.
 
Method Summary
 java.lang.String string()
          Returns the string value of this bString.
 boolean[] toBinArray()
          Converts the value of this bString to an array of boolean.
 byte[] toByteArray()
          Converts the value of this bString to an array of byte.
 java.lang.String toString()
          Returns a string representation of this item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinString

public BinString(java.lang.String string)
Instantiates a BinString and initialize it with a String.

Parameters:
string - The String consist of '0's and '1's.

BinString

public BinString(boolean... array)
Instantiates a BinString and initialize it with an array of boolean.

Parameters:
array - The array of boolean.
Method Detail

string

public java.lang.String string()
Returns the string value of this bString.

Specified by:
string in interface StringItem
Returns:
The hexadecimal string.

toBinArray

public boolean[] toBinArray()
Converts the value of this bString to an array of boolean.

Specified by:
toBinArray in interface StringItem
Returns:
An array of boolean.

toByteArray

public byte[] toByteArray()
Converts the value of this bString to an array of byte.

Specified by:
toByteArray in interface StringItem
Returns:
An array of byte.

toString

public java.lang.String toString()
Returns a string representation of this item.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this item.


Copyright © 2012 BitMeister Inc. All Rights Reserved.