Merge "Add some more public doc for MacAddress" am: a9c0a7e2e2 am: 3b3c6ffdc2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1354447 Change-Id: I5c9061fa832c75c9e0476c54bacec3deb114a96d
This commit is contained in:
@@ -38,7 +38,9 @@ import java.util.Arrays;
|
|||||||
* Representation of a MAC address.
|
* Representation of a MAC address.
|
||||||
*
|
*
|
||||||
* This class only supports 48 bits long addresses and does not support 64 bits long addresses.
|
* This class only supports 48 bits long addresses and does not support 64 bits long addresses.
|
||||||
* Instances of this class are immutable.
|
* Instances of this class are immutable. This class provides implementations of hashCode()
|
||||||
|
* and equals() that make it suitable for use as keys in standard implementations of
|
||||||
|
* {@link java.util.Map}.
|
||||||
*/
|
*/
|
||||||
public final class MacAddress implements Parcelable {
|
public final class MacAddress implements Parcelable {
|
||||||
|
|
||||||
@@ -122,12 +124,22 @@ public final class MacAddress implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Convert this MacAddress to a byte array.
|
||||||
|
*
|
||||||
|
* The returned array is in network order. For example, if this MacAddress is 1:2:3:4:5:6,
|
||||||
|
* the returned array is [1, 2, 3, 4, 5, 6].
|
||||||
|
*
|
||||||
* @return a byte array representation of this MacAddress.
|
* @return a byte array representation of this MacAddress.
|
||||||
*/
|
*/
|
||||||
public @NonNull byte[] toByteArray() {
|
public @NonNull byte[] toByteArray() {
|
||||||
return byteAddrFromLongAddr(mAddr);
|
return byteAddrFromLongAddr(mAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a human-readable representation of this MacAddress.
|
||||||
|
* The exact format is implementation-dependent and should not be assumed to have any
|
||||||
|
* particular format.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public @NonNull String toString() {
|
public @NonNull String toString() {
|
||||||
return stringAddrFromLongAddr(mAddr);
|
return stringAddrFromLongAddr(mAddr);
|
||||||
|
|||||||
Reference in New Issue
Block a user