Example #1
0
 public BinkpFrame(BinkpCommand command, String arg) {
   this.arg = arg;
   isCommand = true;
   this.command = command;
   int arglen = (arg == null) ? 0 : arg.getBytes().length;
   ByteBuffer buf = ByteBuffer.allocate(1 + arglen);
   buf.put((byte) command.getCmd());
   if (arglen > 0) {
     buf.put(arg.getBytes());
   }
   this.data = buf.array();
   init();
 }
Example #2
0
 @Override
 public String toString() {
   return "[ " + ((isCommand) ? command.toString() + " " + arg : " DATA ") + " ]";
 }