aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src/main/java/com/yahoo/slime/Utf8Codec.java
blob: e9f11a90af282db344359e0ef7dc81e66d93d8ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright Yahoo. 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);
    }

}