Class CodedOutputStreamWriter

    • Constructor Detail

      • CodedOutputStreamWriter

        private CodedOutputStreamWriter​(CodedOutputStream output)
    • Method Detail

      • getTotalBytesWritten

        public int getTotalBytesWritten()
      • writeSFixed32

        public void writeSFixed32​(int fieldNumber,
                                  int value)
                           throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.SFIXED32.
        Specified by:
        writeSFixed32 in interface Writer
        Throws:
        java.io.IOException
      • writeInt64

        public void writeInt64​(int fieldNumber,
                               long value)
                        throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.INT64.
        Specified by:
        writeInt64 in interface Writer
        Throws:
        java.io.IOException
      • writeSFixed64

        public void writeSFixed64​(int fieldNumber,
                                  long value)
                           throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.SFIXED64.
        Specified by:
        writeSFixed64 in interface Writer
        Throws:
        java.io.IOException
      • writeFloat

        public void writeFloat​(int fieldNumber,
                               float value)
                        throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.FLOAT.
        Specified by:
        writeFloat in interface Writer
        Throws:
        java.io.IOException
      • writeDouble

        public void writeDouble​(int fieldNumber,
                                double value)
                         throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.DOUBLE.
        Specified by:
        writeDouble in interface Writer
        Throws:
        java.io.IOException
      • writeEnum

        public void writeEnum​(int fieldNumber,
                              int value)
                       throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.ENUM.
        Specified by:
        writeEnum in interface Writer
        Throws:
        java.io.IOException
      • writeUInt64

        public void writeUInt64​(int fieldNumber,
                                long value)
                         throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.UINT64.
        Specified by:
        writeUInt64 in interface Writer
        Throws:
        java.io.IOException
      • writeInt32

        public void writeInt32​(int fieldNumber,
                               int value)
                        throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.INT32.
        Specified by:
        writeInt32 in interface Writer
        Throws:
        java.io.IOException
      • writeFixed64

        public void writeFixed64​(int fieldNumber,
                                 long value)
                          throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.FIXED64.
        Specified by:
        writeFixed64 in interface Writer
        Throws:
        java.io.IOException
      • writeFixed32

        public void writeFixed32​(int fieldNumber,
                                 int value)
                          throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.FIXED32.
        Specified by:
        writeFixed32 in interface Writer
        Throws:
        java.io.IOException
      • writeBool

        public void writeBool​(int fieldNumber,
                              boolean value)
                       throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.BOOL.
        Specified by:
        writeBool in interface Writer
        Throws:
        java.io.IOException
      • writeString

        public void writeString​(int fieldNumber,
                                java.lang.String value)
                         throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.STRING.
        Specified by:
        writeString in interface Writer
        Throws:
        java.io.IOException
      • writeBytes

        public void writeBytes​(int fieldNumber,
                               ByteString value)
                        throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.BYTES.
        Specified by:
        writeBytes in interface Writer
        Throws:
        java.io.IOException
      • writeUInt32

        public void writeUInt32​(int fieldNumber,
                                int value)
                         throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.UINT32.
        Specified by:
        writeUInt32 in interface Writer
        Throws:
        java.io.IOException
      • writeSInt32

        public void writeSInt32​(int fieldNumber,
                                int value)
                         throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.SINT32.
        Specified by:
        writeSInt32 in interface Writer
        Throws:
        java.io.IOException
      • writeSInt64

        public void writeSInt64​(int fieldNumber,
                                long value)
                         throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.SINT64.
        Specified by:
        writeSInt64 in interface Writer
        Throws:
        java.io.IOException
      • writeMessage

        public void writeMessage​(int fieldNumber,
                                 java.lang.Object value)
                          throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.MESSAGE.
        Specified by:
        writeMessage in interface Writer
        Throws:
        java.io.IOException
      • writeMessage

        public void writeMessage​(int fieldNumber,
                                 java.lang.Object value,
                                 Schema schema)
                          throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.MESSAGE.
        Specified by:
        writeMessage in interface Writer
        Throws:
        java.io.IOException
      • writeGroup

        @Deprecated
        public void writeGroup​(int fieldNumber,
                               java.lang.Object value)
                        throws java.io.IOException
        Deprecated.
        Description copied from interface: Writer
        Writes a field of type FieldType.GROUP.
        Specified by:
        writeGroup in interface Writer
        Throws:
        java.io.IOException
      • writeGroup

        public void writeGroup​(int fieldNumber,
                               java.lang.Object value,
                               Schema schema)
                        throws java.io.IOException
        Description copied from interface: Writer
        Writes a field of type FieldType.GROUP.
        Specified by:
        writeGroup in interface Writer
        Throws:
        java.io.IOException
      • writeStartGroup

        @Deprecated
        public void writeStartGroup​(int fieldNumber)
                             throws java.io.IOException
        Deprecated.
        Description copied from interface: Writer
        Writes a single start group tag.
        Specified by:
        writeStartGroup in interface Writer
        Throws:
        java.io.IOException
      • writeEndGroup

        @Deprecated
        public void writeEndGroup​(int fieldNumber)
                           throws java.io.IOException
        Deprecated.
        Description copied from interface: Writer
        Writes a single end group tag.
        Specified by:
        writeEndGroup in interface Writer
        Throws:
        java.io.IOException
      • writeMessageSetItem

        public final void writeMessageSetItem​(int fieldNumber,
                                              java.lang.Object value)
                                       throws java.io.IOException
        Description copied from interface: Writer
        Writes a message field in MessageSet wire-format.
        Specified by:
        writeMessageSetItem in interface Writer
        value - A message instance or an opaque ByteString for an unknown field.
        Throws:
        java.io.IOException
      • writeInt32List

        public void writeInt32List​(int fieldNumber,
                                   java.util.List<java.lang.Integer> value,
                                   boolean packed)
                            throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.INT32.
        Specified by:
        writeInt32List in interface Writer
        Throws:
        java.io.IOException
      • writeFixed32List

        public void writeFixed32List​(int fieldNumber,
                                     java.util.List<java.lang.Integer> value,
                                     boolean packed)
                              throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.FIXED32.
        Specified by:
        writeFixed32List in interface Writer
        Throws:
        java.io.IOException
      • writeInt64List

        public void writeInt64List​(int fieldNumber,
                                   java.util.List<java.lang.Long> value,
                                   boolean packed)
                            throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.INT64.
        Specified by:
        writeInt64List in interface Writer
        Throws:
        java.io.IOException
      • writeUInt64List

        public void writeUInt64List​(int fieldNumber,
                                    java.util.List<java.lang.Long> value,
                                    boolean packed)
                             throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.UINT64.
        Specified by:
        writeUInt64List in interface Writer
        Throws:
        java.io.IOException
      • writeFixed64List

        public void writeFixed64List​(int fieldNumber,
                                     java.util.List<java.lang.Long> value,
                                     boolean packed)
                              throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.FIXED64.
        Specified by:
        writeFixed64List in interface Writer
        Throws:
        java.io.IOException
      • writeFloatList

        public void writeFloatList​(int fieldNumber,
                                   java.util.List<java.lang.Float> value,
                                   boolean packed)
                            throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.FLOAT.
        Specified by:
        writeFloatList in interface Writer
        Throws:
        java.io.IOException
      • writeDoubleList

        public void writeDoubleList​(int fieldNumber,
                                    java.util.List<java.lang.Double> value,
                                    boolean packed)
                             throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.DOUBLE.
        Specified by:
        writeDoubleList in interface Writer
        Throws:
        java.io.IOException
      • writeEnumList

        public void writeEnumList​(int fieldNumber,
                                  java.util.List<java.lang.Integer> value,
                                  boolean packed)
                           throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.ENUM.
        Specified by:
        writeEnumList in interface Writer
        Throws:
        java.io.IOException
      • writeBoolList

        public void writeBoolList​(int fieldNumber,
                                  java.util.List<java.lang.Boolean> value,
                                  boolean packed)
                           throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.BOOL.
        Specified by:
        writeBoolList in interface Writer
        Throws:
        java.io.IOException
      • writeStringList

        public void writeStringList​(int fieldNumber,
                                    java.util.List<java.lang.String> value)
                             throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.STRING.
        Specified by:
        writeStringList in interface Writer
        Throws:
        java.io.IOException
      • writeLazyString

        private void writeLazyString​(int fieldNumber,
                                     java.lang.Object value)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeBytesList

        public void writeBytesList​(int fieldNumber,
                                   java.util.List<ByteString> value)
                            throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.BYTES.
        Specified by:
        writeBytesList in interface Writer
        Throws:
        java.io.IOException
      • writeUInt32List

        public void writeUInt32List​(int fieldNumber,
                                    java.util.List<java.lang.Integer> value,
                                    boolean packed)
                             throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.UINT32.
        Specified by:
        writeUInt32List in interface Writer
        Throws:
        java.io.IOException
      • writeSFixed32List

        public void writeSFixed32List​(int fieldNumber,
                                      java.util.List<java.lang.Integer> value,
                                      boolean packed)
                               throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.SFIXED32.
        Specified by:
        writeSFixed32List in interface Writer
        Throws:
        java.io.IOException
      • writeSFixed64List

        public void writeSFixed64List​(int fieldNumber,
                                      java.util.List<java.lang.Long> value,
                                      boolean packed)
                               throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.SFIXED64.
        Specified by:
        writeSFixed64List in interface Writer
        Throws:
        java.io.IOException
      • writeSInt32List

        public void writeSInt32List​(int fieldNumber,
                                    java.util.List<java.lang.Integer> value,
                                    boolean packed)
                             throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.SINT32.
        Specified by:
        writeSInt32List in interface Writer
        Throws:
        java.io.IOException
      • writeSInt64List

        public void writeSInt64List​(int fieldNumber,
                                    java.util.List<java.lang.Long> value,
                                    boolean packed)
                             throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.SINT64.
        Specified by:
        writeSInt64List in interface Writer
        Throws:
        java.io.IOException
      • writeMessageList

        public void writeMessageList​(int fieldNumber,
                                     java.util.List<?> value)
                              throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.MESSAGE.
        Specified by:
        writeMessageList in interface Writer
        Throws:
        java.io.IOException
      • writeMessageList

        public void writeMessageList​(int fieldNumber,
                                     java.util.List<?> value,
                                     Schema schema)
                              throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.MESSAGE.
        Specified by:
        writeMessageList in interface Writer
        Throws:
        java.io.IOException
      • writeGroupList

        @Deprecated
        public void writeGroupList​(int fieldNumber,
                                   java.util.List<?> value)
                            throws java.io.IOException
        Deprecated.
        Description copied from interface: Writer
        Writes a list field of type FieldType.GROUP.
        Specified by:
        writeGroupList in interface Writer
        Throws:
        java.io.IOException
      • writeGroupList

        public void writeGroupList​(int fieldNumber,
                                   java.util.List<?> value,
                                   Schema schema)
                            throws java.io.IOException
        Description copied from interface: Writer
        Writes a list field of type FieldType.GROUP.
        Specified by:
        writeGroupList in interface Writer
        Throws:
        java.io.IOException
      • writeMap

        public <K,​V> void writeMap​(int fieldNumber,
                                         MapEntryLite.Metadata<K,​V> metadata,
                                         java.util.Map<K,​V> map)
                                  throws java.io.IOException
        Description copied from interface: Writer
        Writes a map field.
        Specified by:
        writeMap in interface Writer
        Throws:
        java.io.IOException
      • writeDeterministicMap

        private <K,​V> void writeDeterministicMap​(int fieldNumber,
                                                       MapEntryLite.Metadata<K,​V> metadata,
                                                       java.util.Map<K,​V> map)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • writeDeterministicBooleanMapEntry

        private <V> void writeDeterministicBooleanMapEntry​(int fieldNumber,
                                                           boolean key,
                                                           V value,
                                                           MapEntryLite.Metadata<java.lang.Boolean,​V> metadata)
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • writeDeterministicIntegerMap

        private <V> void writeDeterministicIntegerMap​(int fieldNumber,
                                                      MapEntryLite.Metadata<java.lang.Integer,​V> metadata,
                                                      java.util.Map<java.lang.Integer,​V> map)
                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • writeDeterministicLongMap

        private <V> void writeDeterministicLongMap​(int fieldNumber,
                                                   MapEntryLite.Metadata<java.lang.Long,​V> metadata,
                                                   java.util.Map<java.lang.Long,​V> map)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • writeDeterministicStringMap

        private <V> void writeDeterministicStringMap​(int fieldNumber,
                                                     MapEntryLite.Metadata<java.lang.String,​V> metadata,
                                                     java.util.Map<java.lang.String,​V> map)
                                              throws java.io.IOException
        Throws:
        java.io.IOException