import { ByteArray } from "./ByteArray" ; export class Protocol { public static strencode ( str ) { let buffer = new ByteArray ( ) ; buffer . length = str . length ; buffer . writeUTFBytes ( str ) ; return buffer ; } public static strdecode ( byte ) { return byte . readUTFBytes ( byte . bytesAvailable ) ; } }