Java Code Examples for com.google.protobuf.GeneratedMessageV3#toByteString()

The following examples show how to use com.google.protobuf.GeneratedMessageV3#toByteString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OkHttpUtil.java    From Android with MIT License 5 votes vote down vote up
/**
 * post(receive ProtoBuff)
 * @param url
 * @param body
 * @param exts
 * @param resultCall
 */
public void postEncrySelf(String url, GeneratedMessageV3 body,SupportKeyUril.EcdhExts exts, final ResultCall resultCall){
    LogManager.getLogger().http("param:" + body.toString());
    ByteString bytes = body == null ? ByteString.copyFrom(new byte[]{}) : body.toByteString();
    Connect.IMRequest imRequest = getIMRequest(exts,MemoryDataManager.getInstance().getPriKey(),
            MemoryDataManager.getInstance().getPubKey(),bytes);
    if(null == imRequest)
        return;
    HttpRequest.getInstance().post(url,imRequest,resultCall);
}
 
Example 2
Source File: OkHttpUtil.java    From Android with MIT License 2 votes vote down vote up
/**
 * post(receive ProtoBuff)
 * @param url
 * @param body
 * @param resultCall
 */
public void postEncrySelf(String url, GeneratedMessageV3 body, final ResultCall resultCall){
    LogManager.getLogger().http("param:" + body.toString());
    ByteString bytes = body == null ? ByteString.copyFrom(new byte[]{}) : body.toByteString();
    postEncrySelf(url,bytes,resultCall);
}
 
Example 3
Source File: OkHttpUtil.java    From Android with MIT License 2 votes vote down vote up
/**
 * post(receive ProtoBuff)
 * @param url
 * @param body
 * @param exts
 * @param priKey
 * @param pubKey
 * @param resultCall
 */
public void postEncry(String url, GeneratedMessageV3 body, SupportKeyUril.EcdhExts exts, String priKey, String pubKey,final ResultCall resultCall){
    LogManager.getLogger().http("param:" + body.toString());
    ByteString bytes = body == null ? ByteString.copyFrom(new byte[]{}) : body.toByteString();
    postEncry(url,bytes,exts,priKey,pubKey,resultCall);
}