ByteArrayData
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.data.ByteArrayData;
Description
Implements
ByteArrayData
implements the following interfaces:
Constructors
// new ByteArrayData(internal as byte[]);new ByteArrayData(myByte[]);
Parameters:
internal: byte[]
Type: byte[]
Operators
Members
Returns: this data as a bool
// ByteArrayData.asBool() as bool;myByteArrayData.asBool();
Return Type:
bool
// ByteArrayData as boolmyByteArrayData as bool
Return Type:
bool
Returns: this data as a byte
// ByteArrayData.asByte() as byte;myByteArrayData.asByte();
Return Type:
byte
// ByteArrayData as bytemyByteArrayData as byte
Return Type:
byte
Returns: this data as a double
// ByteArrayData.asDouble() as double;myByteArrayData.asDouble();
Return Type:
double
// ByteArrayData as doublemyByteArrayData as double
Return Type:
double
Returns: this data as a float
// ByteArrayData.asFloat() as float;myByteArrayData.asFloat();
Return Type:
float
// ByteArrayData as floatmyByteArrayData as float
Return Type:
float
Returns: this data as an int
// ByteArrayData.asInt() as int;myByteArrayData.asInt();
Return Type:
int
// ByteArrayData as intmyByteArrayData as int
Return Type:
int
Returns: this data as a long
// ByteArrayData.asLong() as long;myByteArrayData.asLong();
Return Type:
long
// ByteArrayData as longmyByteArrayData as long
Return Type:
long
Returns: this data as a short
// ByteArrayData.asShort() as short;myByteArrayData.asShort();
Return Type:
short
// ByteArrayData as shortmyByteArrayData as short
Return Type:
short
E.G println(("hello" as IData).asString())
prints "hello"
Returns: The escaped string version of this IData.
// ByteArrayData.asString() as string;myByteArrayData.asString();
Return Type:
string
E.G println(("hello" as IData).getAsString())
prints hello
Returns: The literal string version of this IData.
// ByteArrayData.getAsString() as string;myByteArrayData.getAsString();
Return Type:
string
E.G println(("hello" as IData).getAsString())
prints hello
// ByteArrayData as stringmyByteArrayData as string
Return Type:
string
Returns: the intenral ID of this data.
// ByteArrayData.getId() as byte;myByteArrayData.getId();
Return Type:
byte
// ByteArrayData.isEmpty as boolmyByteArrayData.isEmpty
Return Type:
bool
Returns: True if empty.
// ByteArrayData.isEmpty() as bool;myByteArrayData.isEmpty();
Return Type:
bool
// ByteArrayData.keys as Set<string>myByteArrayData.keys
Return Type:
Set<string>
Returns: The keys of this IData.
// ByteArrayData.keys() as Set<string>;myByteArrayData.keys();
Return Type:
Set<string>
This attempts to give the most accurate type for the given members, for example, if all the members are bytes, then it returns a ByteArrayData.
However if the types are mixed or do not have a *ArrayData version, then a ListData is returned.
Returns: A list of the given members.
Return Type:
IData
Returns: A new IData from the operation
myByteArrayData.map((data) => 3);
Parameters:
Return Type:
IData
// ByteArrayData.remove(key as string);myByteArrayData.remove("key");
Parameters:
key: string
Type: string
- The key to remove.