blob: 86b4acdd3a85ec608e9881a25a53d08b1383418a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.slime;
import com.yahoo.text.Utf8;
/**
* Helper class for conversion between String and UTF-8 representations.
**/
class Utf8Codec {
public static String decode(byte[] data, int pos, int len) {
return Utf8.toString(data, pos, len);
}
public static byte[] encode(String str) {
return Utf8.toBytes(str);
}
}
|