File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ public fun ByteString(vararg bytes: Byte): ByteString = if (bytes.isEmpty()) {
3737
3838/* *
3939 * An immutable wrapper around a byte sequence providing [String] like functionality.
40+ *
41+ * ByteString allows treating binary data as a value and passing it to other functions
42+ * without worrying about data modification.
43+ * The class facilitates various operations on binary data, like comparison or testing for subsequence inclusion.
44+ *
45+ * ByteString is a good fit for untyped binary data that could not be represented as [String],
46+ * like hashes, payload of network packets, encrypted data, etc.
47+ *
48+ * ByteString copies data on creation as well as on conversion back to [ByteArray], thus guaranteeing that subsequent
49+ * modification of source data or data returned from [toByteArray] won't mutate the string itself.
4050 */
4151public class ByteString private constructor(
4252 private val data : ByteArray ,
You can’t perform that action at this time.
0 commit comments