aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/utils.scala
blob: f230be7f2e78b2b2d447139ec05aaca906d4d970 (plain)
1
2
3
4
5
6
7
8
9
package o1game.utils

/** Converts this string to an array of bytes (probably for transmission).
  *
  * @param str the string to convert
  * @return an array of bytes representing the string in UTF8.
  */
def stringToByteArray(str: String): Array[Byte] =
	str.toVector.map(_.toByte).toArray