public byte[] serialize(){
  byte[] value=serializeValue();
  ByteBuffer buffer=ByteBuffer.allocate(value.length + 4);
  buffer.putShort(tag);
  buffer.putShort((short)value.length);
  buffer.put(value);
  return buffer.array();
}

public byte [ ] serialize ( ) { byte [ ] value = serializeValue ( ) ; ByteBuffer buffer = ByteBuffer . allocate ( value . length + 4 ) ; buffer . putShort ( tag ) ; buffer . putShort ( ( short ) value . length ) ; buffer . put ( value ) ; return buffer . array ( ) ; }
convert the optional parameter into a byte serialized form conforming to the smpp specification .
