1 // Generated by the protocol buffer compiler. DO NOT EDIT!
3 package com.android.internal.communication;
5 public final class MsgHeader extends
6 com.google.protobuf.micro.MessageMicro {
9 // required uint32 cmd = 1;
10 public static final int CMD_FIELD_NUMBER = 1;
11 private boolean hasCmd;
13 public int getCmd() { return cmd_; }
14 public boolean hasCmd() { return hasCmd; }
15 public MsgHeader setCmd(int value) {
20 public MsgHeader clearCmd() {
26 // required uint32 length_data = 2;
27 public static final int LENGTH_DATA_FIELD_NUMBER = 2;
28 private boolean hasLengthData;
29 private int lengthData_ = 0;
30 public int getLengthData() { return lengthData_; }
31 public boolean hasLengthData() { return hasLengthData; }
32 public MsgHeader setLengthData(int value) {
37 public MsgHeader clearLengthData() {
38 hasLengthData = false;
43 // optional uint32 status = 3;
44 public static final int STATUS_FIELD_NUMBER = 3;
45 private boolean hasStatus;
46 private int status_ = 0;
47 public int getStatus() { return status_; }
48 public boolean hasStatus() { return hasStatus; }
49 public MsgHeader setStatus(int value) {
54 public MsgHeader clearStatus() {
60 // optional uint64 token = 4;
61 public static final int TOKEN_FIELD_NUMBER = 4;
62 private boolean hasToken;
63 private long token_ = 0L;
64 public long getToken() { return token_; }
65 public boolean hasToken() { return hasToken; }
66 public MsgHeader setToken(long value) {
71 public MsgHeader clearToken() {
77 public final MsgHeader clear() {
86 public final boolean isInitialized() {
87 if (!hasCmd) return false;
88 if (!hasLengthData) return false;
92 public void writeTo(com.google.protobuf.micro.CodedOutputStreamMicro output)
93 throws java.io.IOException {
95 output.writeUInt32(1, getCmd());
97 if (hasLengthData()) {
98 output.writeUInt32(2, getLengthData());
101 output.writeUInt32(3, getStatus());
104 output.writeUInt64(4, getToken());
108 private int cachedSize = -1;
109 public int getCachedSize() {
110 if (cachedSize < 0) {
111 // getSerializedSize sets cachedSize
117 public int getSerializedSize() {
120 size += com.google.protobuf.micro.CodedOutputStreamMicro
121 .computeUInt32Size(1, getCmd());
123 if (hasLengthData()) {
124 size += com.google.protobuf.micro.CodedOutputStreamMicro
125 .computeUInt32Size(2, getLengthData());
128 size += com.google.protobuf.micro.CodedOutputStreamMicro
129 .computeUInt32Size(3, getStatus());
132 size += com.google.protobuf.micro.CodedOutputStreamMicro
133 .computeUInt64Size(4, getToken());
139 public MsgHeader mergeFrom(
140 com.google.protobuf.micro.CodedInputStreamMicro input)
141 throws java.io.IOException {
143 int tag = input.readTag();
148 if (!parseUnknownField(input, tag)) {
154 setCmd(input.readUInt32());
158 setLengthData(input.readUInt32());
162 setStatus(input.readUInt32());
166 setToken(input.readUInt64());
173 public static MsgHeader parseFrom(byte[] data)
174 throws com.google.protobuf.micro.InvalidProtocolBufferMicroException {
175 return (MsgHeader) (new MsgHeader().mergeFrom(data));
178 public static MsgHeader parseFrom(
179 com.google.protobuf.micro.CodedInputStreamMicro input)
180 throws java.io.IOException {
181 return (MsgHeader) (new MsgHeader().mergeFrom(input));