本文整理匯總了Java中com.google.protobuf.CodedOutputStream.writeStringNoTag方法的典型用法代碼示例。如果您正苦於以下問題:Java CodedOutputStream.writeStringNoTag方法的具體用法?Java CodedOutputStream.writeStringNoTag怎麽用?Java CodedOutputStream.writeStringNoTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.protobuf.CodedOutputStream
的用法示例。
在下文中一共展示了CodedOutputStream.writeStringNoTag方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: serialize
import com.google.protobuf.CodedOutputStream; //導入方法依賴的package包/類
@Override
public void serialize(PrecomputedValue obj, CodedOutputStream codedOut)
throws SerializationException, IOException {
ObjectCodecs objectCodecs = objectCodecsSupplier.get();
Object val = obj.get();
Preconditions.checkState(!(val instanceof PrecomputedValue), "recursive precomputed: %s", obj);
// TODO(janakr): this assumes the classifier is the class of the object. This should be enforced
// by the ObjectCodecs instance.
String classifier = val.getClass().getName();
codedOut.writeStringNoTag(classifier);
objectCodecs.serialize(classifier, val, codedOut);
}
示例2: serialize
import com.google.protobuf.CodedOutputStream; //導入方法依賴的package包/類
@Override
public void serialize(DottedVersion obj, CodedOutputStream codedOut) throws IOException {
codedOut.writeInt32NoTag(obj.components.size());
for (Component component : obj.components) {
component.serialize(codedOut);
}
codedOut.writeStringNoTag(obj.stringRepresentation);
codedOut.writeInt32NoTag(obj.numOriginalComponents);
}
示例3: serialize
import com.google.protobuf.CodedOutputStream; //導入方法依賴的package包/類
@Override
public void serialize(RepositoryName repoName, CodedOutputStream codedOut) throws IOException {
boolean isMain = repoName.isMain();
// Main is by far the most common. Use boolean to short-circuit string encoding on
// serialization and byte[]/ByteString creation on deserialization.
codedOut.writeBoolNoTag(isMain);
if (!isMain) {
codedOut.writeStringNoTag(repoName.getName());
}
}
示例4: serialize
import com.google.protobuf.CodedOutputStream; //導入方法依賴的package包/類
@Override
public void serialize(String string, CodedOutputStream codedOut) throws IOException {
codedOut.writeStringNoTag(string);
}
示例5: serialize
import com.google.protobuf.CodedOutputStream; //導入方法依賴的package包/類
@Override
public void serialize(String str, CodedOutputStream codedOut) throws IOException {
codedOut.writeStringNoTag(str);
}