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); }
public static byte[] pascalize(String message) { return pascalize(WChar.getBytes(message)); }