예제 #1
0
  public static String readPascal(DataBuffer dataBuffer) throws EOFException {
    int len = dataBuffer.readInt();
    if (len < 0 || len > 65536) {
      return null;
    }

    byte[] payload = new byte[len];
    dataBuffer.read(payload);
    return WChar.getString(payload, true);
  }
예제 #2
0
 public static byte[] pascalize(String message) {
   return pascalize(WChar.getBytes(message));
 }