public final class ProtoWriter extends Object
Constructor and Description |
---|
ProtoWriter(okio.BufferedSink sink) |
Modifier and Type | Method and Description |
---|---|
void |
writeBytes(okio.ByteString value) |
void |
writeFixed32(int value)
Write a little-endian 32-bit integer.
|
void |
writeFixed64(long value)
Write a little-endian 64-bit integer.
|
void |
writeString(String value) |
void |
writeTag(int fieldNumber,
FieldEncoding fieldEncoding)
Encode and write a tag.
|
void |
writeVarint32(int value)
Encode and write a varint.
|
void |
writeVarint64(long value)
Encode and write a varint.
|
public void writeBytes(okio.ByteString value) throws IOException
IOException
public void writeString(String value) throws IOException
IOException
public void writeTag(int fieldNumber, FieldEncoding fieldEncoding) throws IOException
IOException
public void writeVarint32(int value) throws IOException
value
is treated as unsigned, so it won't be sign-extended
if negative.IOException
public void writeVarint64(long value) throws IOException
IOException
public void writeFixed32(int value) throws IOException
IOException
public void writeFixed64(long value) throws IOException
IOException
Copyright © 2013–2016 Square, Inc.. All rights reserved.