Interface Output
- All Known Subinterfaces:
StatefulOutput
- All Known Implementing Classes:
FilterOutput, GraphProtostuffOutput, JsonOutput, JsonXOutput, KvpOutput, LowCopyProtobufOutput, LowCopyProtostuffOutput, ProtobufOutput, ProtostuffOutput, XmlOutput, XmlXOutput, YamlOutput
public interface Output
An Output lets an application write primitive data types and objects to a sink of data.
-
Method Summary
Modifier and TypeMethodDescriptionvoidwriteBool(int fieldNumber, boolean value, boolean repeated) Writes a boolean field.voidwriteByteArray(int fieldNumber, byte[] value, boolean repeated) Writes a byte array field.voidwriteByteRange(boolean utf8String, int fieldNumber, byte[] value, int offset, int length, boolean repeated) Writes a binary or a pre-encoded utf8 string.voidwriteBytes(int fieldNumber, ByteString value, boolean repeated) Writes a ByteString(wraps byte array) field.voidwriteBytes(int fieldNumber, ByteBuffer value, boolean repeated) voidwriteDouble(int fieldNumber, double value, boolean repeated) Writes a double field.voidwriteEnum(int fieldNumber, int value, boolean repeated) Writes a enum(its number) field.voidwriteFixed32(int fieldNumber, int value, boolean repeated) Writes a fixed int(4 bytes) field.voidwriteFixed64(int fieldNumber, long value, boolean repeated) Writes a fixed long(8 bytes) field.voidwriteFloat(int fieldNumber, float value, boolean repeated) Writes a float field.voidwriteInt32(int fieldNumber, int value, boolean repeated) Writes a variable int field.voidwriteInt64(int fieldNumber, long value, boolean repeated) Writes a variable long field.<T> voidwriteObject(int fieldNumber, T value, Schema<T> schema, boolean repeated) Writes an object(using its schema) field.voidwriteSFixed32(int fieldNumber, int value, boolean repeated) Writes a signed+fixed int(4 bytes) field.voidwriteSFixed64(int fieldNumber, long value, boolean repeated) Writes a signed+fixed long(8 bytes) field.voidwriteSInt32(int fieldNumber, int value, boolean repeated) Writes a signed int field.voidwriteSInt64(int fieldNumber, long value, boolean repeated) Writes a signed long field.voidwriteString(int fieldNumber, CharSequence value, boolean repeated) Writes a String field.voidwriteUInt32(int fieldNumber, int value, boolean repeated) Writes an unsigned int field.voidwriteUInt64(int fieldNumber, long value, boolean repeated) Writes an unsigned long field.
-
Method Details
-
writeInt32
Writes a variable int field.- Throws:
IOException
-
writeUInt32
Writes an unsigned int field.- Throws:
IOException
-
writeSInt32
Writes a signed int field.- Throws:
IOException
-
writeFixed32
Writes a fixed int(4 bytes) field.- Throws:
IOException
-
writeSFixed32
Writes a signed+fixed int(4 bytes) field.- Throws:
IOException
-
writeInt64
Writes a variable long field.- Throws:
IOException
-
writeUInt64
Writes an unsigned long field.- Throws:
IOException
-
writeSInt64
Writes a signed long field.- Throws:
IOException
-
writeFixed64
Writes a fixed long(8 bytes) field.- Throws:
IOException
-
writeSFixed64
Writes a signed+fixed long(8 bytes) field.- Throws:
IOException
-
writeFloat
Writes a float field.- Throws:
IOException
-
writeDouble
Writes a double field.- Throws:
IOException
-
writeBool
Writes a boolean field.- Throws:
IOException
-
writeEnum
Writes a enum(its number) field.- Throws:
IOException
-
writeString
Writes a String field.- Throws:
IOException
-
writeBytes
Writes a ByteString(wraps byte array) field.- Throws:
IOException
-
writeByteArray
Writes a byte array field.- Throws:
IOException
-
writeByteRange
void writeByteRange(boolean utf8String, int fieldNumber, byte[] value, int offset, int length, boolean repeated) throws IOException Writes a binary or a pre-encoded utf8 string.- Throws:
IOException
-
writeObject
<T> void writeObject(int fieldNumber, T value, Schema<T> schema, boolean repeated) throws IOException Writes an object(using its schema) field.- Throws:
IOException
-
writeBytes
- Throws:
IOException
-