Package pt.gov.cartaodecidadao
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 Summary
Constructors Constructor Description PTEID_ByteArray()
Default 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
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.
-
-
-
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 arrayulSize
- is the size of the array
-
-
Method Detail
-
delete
public void delete()
- Overrides:
delete
in 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
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.
-
assign
public PTEID_ByteArray assign(PTEID_ByteArray bytearray)
Copy content of bytearray.
-
-