Package org.hyperledger.besu.plugin.data
Interface BinaryData
-
- All Known Subinterfaces:
Address
,Hash
,Quantity
,UnformattedData
public interface BinaryData
Super class for all types that are ultimately represented by binary data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
getByteArray()
The byte level representation of the binary data.java.lang.String
getHexString()
A hex string representation of the data.int
size()
The size, in bytes, of the contained binary data.
-
-
-
Method Detail
-
getByteArray
byte[] getByteArray()
The byte level representation of the binary data. This array should be treated as read only constant data as any changes will not be reflected in the source.- Returns:
- a read-only array of the bytes of the binary data.
-
getHexString
java.lang.String getHexString()
A hex string representation of the data. This hex string will represent the hex of the entire binary data and will be "0x
" prefixed. APIs that depend on shortend forms will need to process the string.- Returns:
- A string repsenting the hex encodeing of the data.
-
size
int size()
The size, in bytes, of the contained binary data. BecausegetByteArray()
may cause the underlying data to be copied using this size method is preferred when such a check would avoid a call togetByteArray()
orgetHexString()
.- Returns:
- The length of the binary data in bytes.
-
-