public static void appendFinAndOpCode(ByteBuffer buffer,byte opcode,boolean fin){
  byte b=0x00;
  if (fin) {
    b|=0x80;
  }
  b|=opcode & 0x0F;
  buffer.put(b);
}

public static void appendFinAndOpCode ( ByteBuffer buffer , byte opcode , boolean fin ) { byte b = 0x00 ; if ( fin ) { b |= 0x80 ; } b |= opcode & 0x0F ; buffer . put ( b ) ; }
appends the fin flag and the opcode
