Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Shared Function GetBytes(str As String) As Byte()
- Dim bytes As Byte() = New Byte(str.Length * 2 - 1) {}
- System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length)
- Return bytes
- End Function
- Private Shared Function GetString(bytes As Byte()) As String
- Dim chars As Char() = New Char(bytes.Length / 2 - 1) {}
- System.Buffer.BlockCopy(bytes, 0, chars, 0, bytes.Length)
- Return New String(chars)
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement