org.telegram.tl.TLMethod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of telegramapi Show documentation
Show all versions of telegramapi Show documentation
Java library to create Telegram Clients
The newest version!
package org.telegram.tl;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* Basic object for RPC methods. It contains special methods for deserializing result of RPC method call.
*
* @param return type of method
* @author Ruben Bermudez
*/
public abstract class TLMethod extends TLObject {
public T deserializeResponse(byte[] data, TLContext context) throws IOException {
return deserializeResponse(new ByteArrayInputStream(data), context);
}
public T castResponse(TLObject response) {
return (T) response;
}
public abstract T deserializeResponse(InputStream stream, TLContext context) throws IOException;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy