com.dyuproject.protostuff
Interface Output

All Known Subinterfaces:
StatefulOutput
All Known Implementing Classes:
FilterOutput

public interface Output

An Output lets an application write primitive data types and objects to a sink of data.

Author:
David Yu
Date created:
Nov 9, 2009

Method Summary
 void writeBool(int fieldNumber, boolean value, boolean repeated)
          Writes a boolean field.
 void writeByteArray(int fieldNumber, byte[] value, boolean repeated)
          Writes a byte array field.
 void writeByteRange(boolean utf8String, int fieldNumber, byte[] value, int offset, int length, boolean repeated)
          Writes a binary or a pre-encoded utf8 string.
 void writeBytes(int fieldNumber, ByteString value, boolean repeated)
          Writes a ByteString(wraps byte array) field.
 void writeDouble(int fieldNumber, double value, boolean repeated)
          Writes a double field.
 void writeEnum(int fieldNumber, int value, boolean repeated)
          Writes a enum(its number) field.
 void writeFixed32(int fieldNumber, int value, boolean repeated)
          Writes a fixed int(4 bytes) field.
 void writeFixed64(int fieldNumber, long value, boolean repeated)
          Writes a fixed long(8 bytes) field.
 void writeFloat(int fieldNumber, float value, boolean repeated)
          Writes a float field.
 void writeInt32(int fieldNumber, int value, boolean repeated)
          Writes a variable int field.
 void writeInt64(int fieldNumber, long value, boolean repeated)
          Writes a variable long field.
<T> void
writeObject(int fieldNumber, T value, Schema<T> schema, boolean repeated)
          Writes an object(using its schema) field.
 void writeSFixed32(int fieldNumber, int value, boolean repeated)
          Writes a signed+fixed int(4 bytes) field.
 void writeSFixed64(int fieldNumber, long value, boolean repeated)
          Writes a signed+fixed long(8 bytes) field.
 void writeSInt32(int fieldNumber, int value, boolean repeated)
          Writes a signed int field.
 void writeSInt64(int fieldNumber, long value, boolean repeated)
          Writes a signed long field.
 void writeString(int fieldNumber, java.lang.String value, boolean repeated)
          Writes a String field.
 void writeUInt32(int fieldNumber, int value, boolean repeated)
          Writes an unsigned int field.
 void writeUInt64(int fieldNumber, long value, boolean repeated)
          Writes an unsigned long field.
 

Method Detail

writeInt32

void writeInt32(int fieldNumber,
                int value,
                boolean repeated)
                throws java.io.IOException
Writes a variable int field.

Throws:
java.io.IOException

writeUInt32

void writeUInt32(int fieldNumber,
                 int value,
                 boolean repeated)
                 throws java.io.IOException
Writes an unsigned int field.

Throws:
java.io.IOException

writeSInt32

void writeSInt32(int fieldNumber,
                 int value,
                 boolean repeated)
                 throws java.io.IOException
Writes a signed int field.

Throws:
java.io.IOException

writeFixed32

void writeFixed32(int fieldNumber,
                  int value,
                  boolean repeated)
                  throws java.io.IOException
Writes a fixed int(4 bytes) field.

Throws:
java.io.IOException

writeSFixed32

void writeSFixed32(int fieldNumber,
                   int value,
                   boolean repeated)
                   throws java.io.IOException
Writes a signed+fixed int(4 bytes) field.

Throws:
java.io.IOException

writeInt64

void writeInt64(int fieldNumber,
                long value,
                boolean repeated)
                throws java.io.IOException
Writes a variable long field.

Throws:
java.io.IOException

writeUInt64

void writeUInt64(int fieldNumber,
                 long value,
                 boolean repeated)
                 throws java.io.IOException
Writes an unsigned long field.

Throws:
java.io.IOException

writeSInt64

void writeSInt64(int fieldNumber,
                 long value,
                 boolean repeated)
                 throws java.io.IOException
Writes a signed long field.

Throws:
java.io.IOException

writeFixed64

void writeFixed64(int fieldNumber,
                  long value,
                  boolean repeated)
                  throws java.io.IOException
Writes a fixed long(8 bytes) field.

Throws:
java.io.IOException

writeSFixed64

void writeSFixed64(int fieldNumber,
                   long value,
                   boolean repeated)
                   throws java.io.IOException
Writes a signed+fixed long(8 bytes) field.

Throws:
java.io.IOException

writeFloat

void writeFloat(int fieldNumber,
                float value,
                boolean repeated)
                throws java.io.IOException
Writes a float field.

Throws:
java.io.IOException

writeDouble

void writeDouble(int fieldNumber,
                 double value,
                 boolean repeated)
                 throws java.io.IOException
Writes a double field.

Throws:
java.io.IOException

writeBool

void writeBool(int fieldNumber,
               boolean value,
               boolean repeated)
               throws java.io.IOException
Writes a boolean field.

Throws:
java.io.IOException

writeEnum

void writeEnum(int fieldNumber,
               int value,
               boolean repeated)
               throws java.io.IOException
Writes a enum(its number) field.

Throws:
java.io.IOException

writeString

void writeString(int fieldNumber,
                 java.lang.String value,
                 boolean repeated)
                 throws java.io.IOException
Writes a String field.

Throws:
java.io.IOException

writeBytes

void writeBytes(int fieldNumber,
                ByteString value,
                boolean repeated)
                throws java.io.IOException
Writes a ByteString(wraps byte array) field.

Throws:
java.io.IOException

writeByteArray

void writeByteArray(int fieldNumber,
                    byte[] value,
                    boolean repeated)
                    throws java.io.IOException
Writes a byte array field.

Throws:
java.io.IOException

writeByteRange

void writeByteRange(boolean utf8String,
                    int fieldNumber,
                    byte[] value,
                    int offset,
                    int length,
                    boolean repeated)
                    throws java.io.IOException
Writes a binary or a pre-encoded utf8 string.

Throws:
java.io.IOException

writeObject

<T> void writeObject(int fieldNumber,
                     T value,
                     Schema<T> schema,
                     boolean repeated)
                 throws java.io.IOException
Writes an object(using its schema) field.

Throws:
java.io.IOException


Copyright © 2009-2013. All Rights Reserved.