Package org.symbol.sdk.nem
Class Address
java.lang.Object
org.symbol.sdk.ByteArray
org.symbol.sdk.nem.Address
- All Implemented Interfaces:
- Address
Represents a NEM address;
toString()returns the base32-encoded form.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intLength of encoded address string.static final intByte size of raw address. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Addressdeserialize(byte[] payload) Deserializes a NEM address from a payload, consuming exactlySIZEbytes.static Addressdeserialize(byte[] payload, int offset) Deserializes a NEM address from a payload, consuming exactlySIZEbytes starting atoffset.static AddressParses a raw value (Address, base32 string, byte array, or SDK ByteArray) into a Address.toString()Returns the external string representation — hex by default.
-
Field Details
-
SIZE
public static final int SIZEByte size of raw address.- See Also:
-
ENCODED_SIZE
public static final int ENCODED_SIZELength of encoded address string.- See Also:
-
-
Constructor Details
-
Address
public Address()Creates a default-initialized (all-zero bytes) NEM address. -
Address
public Address(byte[] bytes) Creates a NEM address from raw bytes.- Parameters:
bytes- Raw address bytes.
-
Address
Creates a NEM address from a base32 string.- Parameters:
addressString- Encoded address string.
-
Address
Copy constructor.- Parameters:
other- Other address.
-
-
Method Details
-
parse
- Parameters:
rawValue- Raw value.- Returns:
Parsed value.
-
deserialize
- Address.deserialize
Deserializes a NEM address from a payload, consuming exactly
SIZEbytes.
- Parameters:
payload- Buffer to read from; only the firstSIZEbytes are consumed.- Returns:
Deserialized address.
-
deserialize
- Address.deserialize
Deserializes a NEM address from a payload, consuming exactly
SIZEbytes starting atoffset.
- Parameters:
payload- Buffer to read from.offset- Offset into the payload at which to start reading.- Returns:
Deserialized address.
- Throws:
IndexOutOfBoundsException- if fewer thanSIZEbytes remain atoffset.
-
toString
- Address.toString
Description copied from class:
ByteArray
Returns the external string representation — hex by default.
-