ByteVector
Companion for ByteVector.
- Companion
- class
trait ByteVectorPlatform
class Object
trait Matchable
class Any
Document{}
Constructs a
byte is used of each integral value.
ByteVector
from a list of literal bytes. Only the least significantbyte is used of each integral value.
Constructs a
is copied to ensure the resulting
If this is not desired, use
ByteVector
from an Array[Byte]
. The given Array[Byte]
is copied to ensure the resulting
ByteVector
is immutable.If this is not desired, use
ByteVector.view
.Constructs a
The given
If this is not desired, use
ByteVector
from an Array[Byte]
, an offset, and a length.The given
Array[Byte]
is copied to ensure the resulting ByteVector
is immutable.If this is not desired, use
ByteVector.view
.Constructs a
is copied to ensure the resulting
If this is not desired, use
ByteVector
from a ByteBuffer
. The given ByteBuffer
isis copied to ensure the resulting
ByteVector
is immutable.If this is not desired, use
ByteVector.view
.The returned vector is a copy of a subsequence of the buffer, with bounds
determined by the buffer's position and limit at the time this method is called.
determined by the buffer's position and limit at the time this method is called.
Constructs a
does not make a copy of the input array, so callers should take care
not to modify the contents of the array passed to this function.
ByteVector
from an Array[Byte]
. Unlike apply
, thisdoes not make a copy of the input array, so callers should take care
not to modify the contents of the array passed to this function.
Constructs a
Unlike
callers should take care not to modify the contents of the array
passed to this function.
ByteVector
from a slice of an Array[Byte]
.Unlike
apply
, this does not make a copy of the input array, socallers should take care not to modify the contents of the array
passed to this function.
Constructs a
does not make a copy of the input buffer, so callers should take care
not to modify the contents of the buffer passed to this function.
ByteVector
from a ByteBuffer
. Unlike apply
, thisdoes not make a copy of the input buffer, so callers should take care
not to modify the contents of the buffer passed to this function.
The returned vector is a view of a subsequence of the buffer, with bounds
determined by the buffer's position and limit at the time this method is called.
determined by the buffer's position and limit at the time this method is called.
Constructs a
where the
ByteVector
from a function from Long => Int
and a size,where the
Int
returned by at
must fit in a Byte
.Constructs a
ByteVector
vector with the 2's complement encoding of the specified byte.- Value Params
- b
-
value to encode
Constructs a
ByteVector
vector with the 2's complement encoding of the specified value.- Value Params
- ordering
-
byte ordering of vector
- s
-
value to encode
- size
-
size of vector (<= 2)
Constructs a
ByteVector
with the 2's complement encoding of the specified value.- Value Params
- i
-
value to encode
- ordering
-
byte ordering of vector
- size
-
size of vector (<= 4)
Constructs a
ByteVector
with the 2's complement encoding of the specified value.- Value Params
- l
-
value to encode
- ordering
-
byte ordering of vector
- size
-
size of vector (<= 8)
Constructs a
The bytes are in MSB-to-LSB order.
ByteVector
containing the binary representation of the specified UUID.The bytes are in MSB-to-LSB order.
- Value Params
- u
-
value to encode
Constructs a
ByteVector
from a hexadecimal string or returns an error message if the string is not valid hexadecimal.The string may start with a
0x
and it may contain whitespace or underscore characters.Constructs a
ByteVector
from a hexadecimal string or returns None
if the string is not valid hexadecimal.The string may start with a
0x
and it may contain whitespace or underscore characters.Constructs a
ByteVector
from a hexadecimal string or throws an IllegalArgumentException if the string is not valid hexadecimal.The string may start with a
0x
and it may contain whitespace or underscore characters.- Throws
- IllegalArgumentException
- IllegalArgumentException
Constructs a
ByteVector
from a binary string or returns an error message if the string is not valid binary.The string may start with a
0b
and it may contain whitespace or underscore characters.Constructs a
ByteVector
from a binary string or returns None
if the string is not valid binary.The string may start with a
0b
and it may contain whitespace or underscore characters.Constructs a
ByteVector
from a binary string or throws an IllegalArgumentException if the string is not valid binary.The string may start with a
0b
and it may contain whitespace or underscore characters.- Throws
- IllegalArgumentException
- IllegalArgumentException
Constructs a
An empty input string results in an empty ByteVector.
The string may contain whitespace characters and hyphens which are ignored.
ByteVector
from a base 32 string or returns an error message if the string is not valid base 32.An empty input string results in an empty ByteVector.
The string may contain whitespace characters and hyphens which are ignored.
Constructs a
Details pertaining to base 32 decoding can be found in the comment for fromBase32Descriptive.
The string may contain whitespace characters which are ignored.
ByteVector
from a base 64 string or returns None
if the string is not valid base 32.Details pertaining to base 32 decoding can be found in the comment for fromBase32Descriptive.
The string may contain whitespace characters which are ignored.
Constructs a
Details pertaining to base 32 decoding can be found in the comment for fromBase32Descriptive.
The string may contain whitespace characters which are ignored.
ByteVector
from a base 32 string or throws an IllegalArgumentException if the string is not valid base 32.Details pertaining to base 32 decoding can be found in the comment for fromBase32Descriptive.
The string may contain whitespace characters which are ignored.
- Throws
- IllegalArgumentException
- IllegalArgumentException
Constructs a
It is similar to Base64 but has been modified to avoid both non-alphanumeric characters and letters which might look ambiguous when printed.
It is therefore designed for human users who manually enter the data, copying from some visual source
Compared to Base64, the following similar-looking letters are omitted: 0 (zero), O (capital o), I (capital i) and l (lower case L)
as well as the non-alphanumeric characters + (plus) and / (slash).
The actual order of letters in the alphabet depends on the application, the default order is the same used in Bitcoin
An empty input string results in an empty ByteVector.
The string may contain whitespace characters which are ignored.
ByteVector
from a base 58 string or returns an error message if the string is not valid base 58.It is similar to Base64 but has been modified to avoid both non-alphanumeric characters and letters which might look ambiguous when printed.
It is therefore designed for human users who manually enter the data, copying from some visual source
Compared to Base64, the following similar-looking letters are omitted: 0 (zero), O (capital o), I (capital i) and l (lower case L)
as well as the non-alphanumeric characters + (plus) and / (slash).
The actual order of letters in the alphabet depends on the application, the default order is the same used in Bitcoin
An empty input string results in an empty ByteVector.
The string may contain whitespace characters which are ignored.
Constructs a
Details pertaining to base 58 decoding can be found in the comment for fromBase58Descriptive.
The string may contain whitespace characters which are ignored.
ByteVector
from a base 58 string or returns None
if the string is not valid base 58.Details pertaining to base 58 decoding can be found in the comment for fromBase58Descriptive.
The string may contain whitespace characters which are ignored.
Constructs a
Details pertaining to base 58 decoding can be found in the comment for fromBase58Descriptive.
The string may contain whitespace characters which are ignored.
ByteVector
from a base 58 string or throws an IllegalArgumentException if the string is not valid base 58.Details pertaining to base 58 decoding can be found in the comment for fromBase58Descriptive.
The string may contain whitespace characters which are ignored.
- Throws
- IllegalArgumentException
- IllegalArgumentException
Constructs a
If the final encoding quantum does not contain 4 characters, i.e. the total number of characters is not evenly divisible
by 4, padding is inferred if the final quantum contains 2 or 3 characters. This is to say that padding is optional as
long as the inferred padding would yield a valid base 64 string. The input is considered invalid if the final quantum
only contains a single character. If padding characters are present, they must be used in accordance with the base 64
specification and no padding characters will be inferred.
An empty input string results in an empty ByteVector.
The string may contain whitespace characters which are ignored.
ByteVector
from a base 64 string or returns an error message if the string is not valid base 64.If the final encoding quantum does not contain 4 characters, i.e. the total number of characters is not evenly divisible
by 4, padding is inferred if the final quantum contains 2 or 3 characters. This is to say that padding is optional as
long as the inferred padding would yield a valid base 64 string. The input is considered invalid if the final quantum
only contains a single character. If padding characters are present, they must be used in accordance with the base 64
specification and no padding characters will be inferred.
An empty input string results in an empty ByteVector.
The string may contain whitespace characters which are ignored.
Constructs a
Details pertaining to base 64 decoding can be found in the comment for fromBase64Descriptive.
The string may contain whitespace characters which are ignored.
ByteVector
from a base 64 string or returns None
if the string is not valid base 64.Details pertaining to base 64 decoding can be found in the comment for fromBase64Descriptive.
The string may contain whitespace characters which are ignored.
Constructs a
Details pertaining to base 64 decoding can be found in the comment for fromBase64Descriptive.
The string may contain whitespace characters which are ignored.
ByteVector
from a base 64 string or throws an IllegalArgumentException if the string is not valid base 64.Details pertaining to base 64 decoding can be found in the comment for fromBase64Descriptive.
The string may contain whitespace characters which are ignored.
- Throws
- IllegalArgumentException
- IllegalArgumentException