Class BinaryResourceValue
- java.lang.Object
-
- com.google.devrel.gmscore.tools.apk.arsc.BinaryResourceValue
-
- All Implemented Interfaces:
SerializableResource
public class BinaryResourceValue extends java.lang.Object implements SerializableResource
Represents a single typed resource value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBinaryResourceValue.TypeResource type codes.
-
Field Summary
Fields Modifier and Type Field Description static intSIZEThe serialized size in bytes of aBinaryResourceValue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BinaryResourceValuecreate(java.nio.ByteBuffer buffer)intdata()The actual 4-byte value; interpretation of the value depends ondataType.booleanequals(java.lang.Object o)inthashCode()intsize()The length in bytes of this value.byte[]toByteArray()Converts this resource into an array of bytes representation.byte[]toByteArray(boolean shrink)Converts this resource into an array of bytes representation.BinaryResourceValue.Typetype()The raw data type of this value.
-
-
-
Field Detail
-
SIZE
public static final int SIZE
The serialized size in bytes of aBinaryResourceValue.- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static BinaryResourceValue create(java.nio.ByteBuffer buffer)
-
size
public int size()
The length in bytes of this value.
-
type
public BinaryResourceValue.Type type()
The raw data type of this value.
-
data
public int data()
The actual 4-byte value; interpretation of the value depends ondataType.
-
toByteArray
public byte[] toByteArray()
Description copied from interface:SerializableResourceConverts this resource into an array of bytes representation.- Specified by:
toByteArrayin interfaceSerializableResource- Returns:
- An array of bytes representing this resource.
-
toByteArray
public byte[] toByteArray(boolean shrink)
Description copied from interface:SerializableResourceConverts this resource into an array of bytes representation.- Specified by:
toByteArrayin interfaceSerializableResource- Parameters:
shrink- True if, when converting to a byte array, this resource can modify the returned bytes in an effort to reduce the size.- Returns:
- An array of bytes representing this resource.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-