Bytes
haxe.io.Bytes (Class)
Static Members
Returns a new Bytes
instance with the given length
. The values of the
bytes are not initialized and may not be zero.
Returns the Bytes
representation of the given String
, using the
specified encoding (UTF-8 by default).
Name |
Type |
Default |
s |
String |
|
encoding |
Anonymous |
(optional) |
Returns the Bytes
representation of the given BytesData
.
Converts the given hexadecimal String
to Bytes
. s
must be a string of
even length consisting only of hexadecimal digits. For example:
"0FDA14058916052309"
.
Instance Members
Returns the byte at index pos
.
Stores the given byte v
at the given position pos
.
Copies len
bytes from src
into this instance.
Name |
Type |
Description |
pos |
Int |
Zero-based location in this instance at which to start writing bytes. |
src |
Bytes |
Source Bytes instance from which to copy bytes. |
srcpos |
Int |
Zero-based location at src from which bytes will be copied. |
len |
Int |
Number of bytes to be copied. |
Sets len
consecutive bytes starting from index pos
of this
instance
to value
.
Returns a new Bytes
instance that contains a copy of len
bytes of
this
instance, starting at index pos
.
Returns 0
if the bytes of this
instance and the bytes of other
are
identical.
Returns a negative value if the length
of this
instance is less than
the length
of other
, or a positive value if the length
of this
instance is greater than the length
of other
.
In case of equal length
s, returns a negative value if the first different
value in other
is greater than the corresponding value in this
instance; otherwise returns a positive value.
Returns the 16-bit unsigned integer at the given position pos
(in
little-endian encoding).
Stores the given 16-bit unsigned integer v
at the given position pos
(in little-endian encoding).
Returns the 32-bit integer at the given position pos
(in little-endian
encoding).
Stores the given 32-bit integer v
at the given position pos
(in
little-endian encoding).
Returns the len
-bytes long string stored at the given position pos
,
interpreted with the given encoding
(UTF-8 by default).
Name |
Type |
Default |
pos |
Int |
|
len |
Int |
|
encoding |
Anonymous |
(optional) |
Returns a String
representation of the bytes interpreted as UTF-8.
Returns the bytes of this
instance as BytesData
.
Private Members