Package com.unboundid.util
Class ByteStringFactory
- java.lang.Object
-
- com.unboundid.util.ByteStringFactory
-
@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class ByteStringFactory extends java.lang.Object
This class provides a mechanism for creatingByteString
values.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ByteString
create()
Creates a new byte string with no value.static ByteString
create(byte[] value)
Creates a new byte string with the provided value.static ByteString
create(byte[] value, int offset, int length)
Creates a new byte string with the provided value.static ByteString
create(java.lang.String value)
Creates a new byte string with the provided value.
-
-
-
Method Detail
-
create
@NotNull public static ByteString create()
Creates a new byte string with no value.- Returns:
- The created byte string.
-
create
@NotNull public static ByteString create(@Nullable byte[] value)
Creates a new byte string with the provided value.- Parameters:
value
- The value to use for the byte string.- Returns:
- The created byte string.
-
create
@NotNull public static ByteString create(@NotNull byte[] value, int offset, int length)
Creates a new byte string with the provided value.- Parameters:
value
- The byte array containing the data to use for the value. It must not benull
.offset
- The position in the array at which the value begins. It must be greater than or equal to zero and less or equal to the end of the array.length
- The number of bytes contained in the value. It must be greater than or equal to zero, and the sum of the offset and the length must be less than or equal to the end of the array.- Returns:
- The created byte string.
-
create
@NotNull public static ByteString create(@Nullable java.lang.String value)
Creates a new byte string with the provided value.- Parameters:
value
- The value to use for the byte string.- Returns:
- The created byte string.
-
-