public static byte[] InterceptByte(byte[] data, int startIndex,
int endIndex)
{
String str = null;
byte[] resultData = null;
try
{
str = new String(data, "utf-8");
if (startIndex != -1 && endIndex != -1 && endIndex > startIndex)
{
resultData = str.substring(startIndex,
endIndex + endIndex).getBytes("utf-8");
}
}
catch (UnsupportedEncodingException e)
{
e.printStackTrace();
}
finally
{
str = null;
}
return resultData;
}
java btye[]截取乱码的解决
最新推荐文章于 2022-10-05 22:32:26 发布