@Override public byte[] encode(){
  byte binValue[]=new byte[HEADER_LENGTH + getDataLength() + (4 - getDataLength() % 4) % 4];
  binValue[0]=(byte)(getAttributeType() >> 8);
  binValue[1]=(byte)(getAttributeType() & 0x00FF);
  binValue[2]=(byte)(getDataLength() >> 8);
  binValue[3]=(byte)(getDataLength() & 0x00FF);
  binValue[4]=0x00;
  binValue[5]=0x00;
  binValue[6]=getErrorClass();
  binValue[7]=getErrorNumber();
  if (reasonPhrase != null)   System.arraycopy(reasonPhrase,0,binValue,8,reasonPhrase.length);
  return binValue;
}

@ Override public byte [ ] encode ( ) { byte binValue [ ] = new byte [ HEADER_LENGTH + getDataLength ( ) + ( 4 - getDataLength ( ) % 4 ) % 4 ] ; binValue [ 0 ] = ( byte ) ( getAttributeType ( ) > > 8 ) ; binValue [ 1 ] = ( byte ) ( getAttributeType ( ) & 0x00FF ) ; binValue [ 2 ] = ( byte ) ( getDataLength ( ) > > 8 ) ; binValue [ 3 ] = ( byte ) ( getDataLength ( ) & 0x00FF ) ; binValue [ 4 ] = 0x00 ; binValue [ 5 ] = 0x00 ; binValue [ 6 ] = getErrorClass ( ) ; binValue [ 7 ] = getErrorNumber ( ) ; if ( reasonPhrase != null ) System . arraycopy ( reasonPhrase , 0 , binValue , 8 , reasonPhrase . length ) ; return binValue ; }
returns a binary representation of this attribute .
