Package pt.gov.cartaodecidadao
Class PTEID_ByteArray
java.lang.Object
pt.gov.cartaodecidadao.PTEID_Object
pt.gov.cartaodecidadao.PTEID_ByteArray
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
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 Summary
ConstructorsConstructorDescriptionDefault constructorPTEID_ByteArray(byte[] pucData, long ulSize) Constructor - initialize a byte array with an array of unsigned char.
PTEID_ByteArray(PTEID_ByteArray bytearray) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidAppend(byte[] pucData, long ulSize) Append data to the byte array.
voidAppend(PTEID_ByteArray data) Append data to the byte array.assign(PTEID_ByteArray bytearray) Copy content of bytearray.voidClear()Remove the data from the byte array.voiddelete()booleanEquals(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.GetStringAt(long ulOffset, long ulLen) Get a string from buffer at ulOffset position and with ulLen size.longSize()Return the number of bytes in the array.booleanwriteToFile(String csFilePath) Writing the binary content to a file.
-
Constructor Details
-
PTEID_ByteArray
public PTEID_ByteArray()Default constructor -
PTEID_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 arrayulSize- is the size of the array
-
-
Method Details
-
delete
public void delete()- Overrides:
deletein classPTEID_Object
-
Append
public void Append(byte[] pucData, long ulSize) Append data to the byte array.
- Parameters:
pucData- is the byte arrayulSize- is the size of the array
-
Append
Append data to the byte array. -
Clear
public void Clear()Remove the data from the byte array. -
Equals
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
Get a string from buffer at ulOffset position and with ulLen size. -
writeToFile
Writing the binary content to a file. -
assign
Copy content of bytearray.
-