public class StringUtf8Utils extends Object
StringUtf8Utils
refers to the implementation from SerializeWriter and IOUtils of Alibaba fastjson.
The difference is that StringUtf8Utils need to handle the wrong code, just like StringCoding.decode.
Constructor and Description |
---|
StringUtf8Utils() |
Modifier and Type | Method and Description |
---|---|
static String |
decodeUTF8(byte[] input,
int offset,
int byteLen) |
static String |
decodeUTF8(MemorySegment input,
int offset,
int byteLen) |
static int |
decodeUTF8Strict(byte[] sa,
int sp,
int len,
char[] da) |
static int |
decodeUTF8Strict(MemorySegment segment,
int sp,
int len,
char[] da) |
static String |
defaultDecodeUTF8(byte[] bytes,
int offset,
int len) |
static int |
defaultEncodeUTF8(String str,
byte[] bytes) |
static byte[] |
encodeUTF8(String str)
This method must have the same result with JDK's String.getBytes.
|
static int |
encodeUTF8(String str,
byte[] bytes) |
public static byte[] encodeUTF8(String str)
public static int encodeUTF8(String str, byte[] bytes)
public static int defaultEncodeUTF8(String str, byte[] bytes)
public static String decodeUTF8(byte[] input, int offset, int byteLen)
public static int decodeUTF8Strict(byte[] sa, int sp, int len, char[] da)
public static String decodeUTF8(MemorySegment input, int offset, int byteLen)
public static int decodeUTF8Strict(MemorySegment segment, int sp, int len, char[] da)
public static String defaultDecodeUTF8(byte[] bytes, int offset, int len)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.