ByteContainer



com.licel.jcardsim.crypto
Class ByteContainer

java.lang.Object
  extended by com.licel.jcardsim.crypto.ByteContainer

public final class ByteContainer
extends Object

This class contains byte array, initialization flag of this array and memory type


Constructor Summary
ByteContainer()
          Construct ByteContainer with memory type JCSystem.MEMORY_TYPE_PERSISTENT
ByteContainer(BigInteger bInteger)
          Construct ByteContainer with memory type JCSystem.MEMORY_TYPE_PERSISTENT and fills it by byte representation of BigInteger
ByteContainer(byte memoryType)
          Construct ByteContainer with defined memory type
ByteContainer(byte[] buff, short offset, short length)
          Construct ByteContainer with memory type JCSystem.MEMORY_TYPE_PERSISTENT and fills it by defined byte array
 
Method Summary
 void clear()
          Clear internal structure of the ByteContainer
 BigInteger getBigInteger()
          Return BigInteger representation of the ByteContainer
 byte[] getBytes(byte event)
          Return transient plain byte array representation of the ByteContainer
 short getBytes(byte[] dest, short offset)
          Copy byte array representation of the ByteContainer
 boolean isInitialized()
           
 void setBigInteger(BigInteger bInteger)
          Fills ByteContainerby byte representation of BigInteger
 void setBytes(byte[] buff)
          Fills ByteContainerby defined byte array
 void setBytes(byte[] buff, short offset, short length)
          Fills ByteContainerby defined byte array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteContainer

public ByteContainer()
Construct ByteContainer with memory type JCSystem.MEMORY_TYPE_PERSISTENT


ByteContainer

public ByteContainer(byte memoryType)
Construct ByteContainer with defined memory type

Parameters:
memoryType - memoryType from JCSystem.MEMORY_..

ByteContainer

public ByteContainer(BigInteger bInteger)
Construct ByteContainer with memory type JCSystem.MEMORY_TYPE_PERSISTENT and fills it by byte representation of BigInteger

Parameters:
bInteger - BigInteger object

ByteContainer

public ByteContainer(byte[] buff,
                     short offset,
                     short length)
Construct ByteContainer with memory type JCSystem.MEMORY_TYPE_PERSISTENT and fills it by defined byte array

Parameters:
buff - byte array
offset -
length -
Method Detail

setBigInteger

public void setBigInteger(BigInteger bInteger)
Fills ByteContainerby byte representation of BigInteger

Parameters:
bInteger -

setBytes

public void setBytes(byte[] buff)
Fills ByteContainerby defined byte array

Parameters:
buff -

setBytes

public void setBytes(byte[] buff,
                     short offset,
                     short length)
Fills ByteContainerby defined byte array

Parameters:
buff -
offset -
length -

getBigInteger

public BigInteger getBigInteger()
Return BigInteger representation of the ByteContainer

Returns:
BigInteger

getBytes

public byte[] getBytes(byte event)
Return transient plain byte array representation of the ByteContainer

Parameters:
event - type of transient byte array
Returns:
plain byte array

getBytes

public short getBytes(byte[] dest,
                      short offset)
Copy byte array representation of the ByteContainer

Parameters:
dest - destination byte array
offset -
Returns:
bytes copies

clear

public void clear()
Clear internal structure of the ByteContainer


isInitialized

public boolean isInitialized()