将字节数组转换为Pascal字符串。
//package com.nowjava; /* *来 自 N o w J a v a . c o m */ import java.nio.charset.Charset; public class Main { public static void main(String[] argv) throws Exception { byte[] data = new byte[] { 34, 35, 36, 37, 37, 37, 67, 68, 69 }; System.out.println(bytesToPascalString(data)); } private final static Charset LATIN1 = Charset.availableCharsets().get( "ISO-8859-1"); /** * Convert a byte array to a Pascal string. The first byte is the byte count, * followed by that many active characters. */ public static String bytesToPascalString(byte[] data) {