Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void Append​(byte[] pucData, long ulSize)
      Append data to the byte array.

      void Append​(PTEID_ByteArray data)
      Append data to the byte array.
      PTEID_ByteArray assign​(PTEID_ByteArray bytearray)
      Copy content of bytearray.
      void Clear()
      Remove the data from the byte array.
      void delete()  
      boolean Equals​(PTEID_ByteArray data)
      Return true if the content of data is the same as this.
      byte[] GetBytes()
      Return the array of bytes in the object.
      If Size() == 0, then NULL is returned.
      java.lang.String GetStringAt​(long ulOffset, long ulLen)
      Get a string from buffer at ulOffset position and with ulLen size.
      long Size()
      Return the number of bytes in the array.
      boolean writeToFile​(java.lang.String csFilePath)
      Writing the binary content to a file.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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 Detail

      • 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 java.lang.String GetStringAt​(long ulOffset,
                                            long ulLen)
        Get a string from buffer at ulOffset position and with ulLen size.
      • writeToFile

        public boolean writeToFile​(java.lang.String csFilePath)
        Writing the binary content to a file.