Overgram/lib/src/main/java/io/github/lonamiwebs/overgram/tl/RPCResult.java

32 lines
961 B
Java

package io.github.lonamiwebs.overgram.tl;
import io.github.lonamiwebs.overgram.utils.BinaryReader;
import io.github.lonamiwebs.overgram.utils.BinaryWriter;
public class RPCResult extends TLObject {
public static final int CONSTRUCTOR_ID = -212046591;
public long reqMsgId;
public Types.RpcError error;
public byte[] result;
@Override
public void serialize(final BinaryWriter writer) {
throw new UnsupportedOperationException();
}
@Override
public void deserialize(final BinaryReader reader) throws ClassNotFoundException {
reqMsgId = reader.readLong();
final int code = reader.readInt();
if (code == Types.RpcError.CONSTRUCTOR_ID) {
error = new Types.RpcError();
error.deserialize(reader);
} else if (code == GzipPacked.CONSTRUCTOR_ID) {
result = GzipPacked.unzip(reader);
} else {
result = reader.read();
}
}
}