public SUBACK decode(MQTTFrame frame) throws ProtocolException {
assert(frame.buffers.length == 1);
DataByteArrayInputStream is = new DataByteArrayInputStream(frame.buffers[0]);
messageId = is.readShort();
grantedQos = is.readBuffer(is.available()).toByteArray();
return this;
}
public MQTTFrame encode() {
try {