Class PTEID_ByteArray

java.lang.Object
pt.gov.cartaodecidadao.PTEID_Object
pt.gov.cartaodecidadao.PTEID_ByteArray

public class PTEID_ByteArray extends PTEID_Object
Class used to receive and supply an array of bytes from/to different methods in the SDK.

Memory management note - instances of this class will not own the char arrays that are supplied to
it in the constructor or Append() methods as this class will perform copies of the input arrays
  • Constructor Details

    • PTEID_ByteArray

      public PTEID_ByteArray()
      Default constructor
    • PTEID_ByteArray

      public PTEID_ByteArray(PTEID_ByteArray bytearray)
      Copy constructor
    • PTEID_ByteArray

      public PTEID_ByteArray(byte[] pucData, long ulSize)
      Constructor - initialize a byte array with an array of unsigned char.

      Parameters:
      pucData - is the byte array
      ulSize - is the size of the array
  • Method Details

    • delete

      public void delete()
      Overrides:
      delete in class PTEID_Object
    • Append

      public void Append(byte[] pucData, long ulSize)
      Append data to the byte array.

      Parameters:
      pucData - is the byte array
      ulSize - is the size of the array
    • Append

      public void Append(PTEID_ByteArray data)
      Append data to the byte array.
    • Clear

      public void Clear()
      Remove the data from the byte array.
    • Equals

      public boolean Equals(PTEID_ByteArray data)
      Return true if the content of data is the same as this.
    • Size

      public long Size()
      Return the number of bytes in the array.
    • GetBytes

      public byte[] GetBytes()
      Return the array of bytes in the object.
      If Size() == 0, then NULL is returned.
    • GetStringAt

      public String GetStringAt(long ulOffset, long ulLen)
      Get a string from buffer at ulOffset position and with ulLen size.
    • writeToFile

      public boolean writeToFile(String csFilePath)
      Writing the binary content to a file.
    • assign

      public PTEID_ByteArray assign(PTEID_ByteArray bytearray)
      Copy content of bytearray.