congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
WriteSink
Code IndexAdd Tabnine to your IDE (free)

How to use
WriteSink
in
io.protostuff

Best Java code snippets using io.protostuff.WriteSink (Showing top 20 results out of 315)

origin: protostuff/protostuff

static LinkedBuffer writeTag(final String name, final boolean repeated,
    final WriteSink sink, final WriteSession session, LinkedBuffer lb)
    throws IOException
{
  lb = sink.writeStrAscii(name,
      session,
      sink.writeByte(
          EXCLAMATION,
          session,
          lb));
  if (repeated)
    return sink.writeByteArray(EMPTY_ARRAY, session, lb);
  return lb;
}
origin: protostuff/protostuff

  tail = sink.writeByte(
      QUOTE,
      this,
      sink.writeByteArrayB64(
          value, 0, value.length,
          this,
          sink.writeByteArray(
              COMMA_AND_QUOTE,
              this,
tail = sink.writeByte(
    QUOTE,
    this,
    sink.writeByteArrayB64(
        value, 0, value.length,
        this,
origin: protostuff/protostuff

@Override
public void writeInt32(int fieldNumber, int value, boolean repeated) throws IOException
{
  final String name = schema.getFieldName(fieldNumber);
  tail = sink.writeByte(END_TAG, this,
      sink.writeStrAscii(name, this,
          sink.writeByteArray(START_SLASH_TAG, this,
              sink.writeStrFromInt(value, this,
                  sink.writeByte(END_TAG, this,
                      sink.writeStrAscii(name, this,
                          sink.writeByte(START_TAG, this, tail)))))));
}
origin: protostuff/protostuff

private void writeB64(String name, byte[] value, int offset, int length,
    boolean repeated) throws IOException
{
  tail = sink.writeByte(END_TAG, this,
      sink.writeStrAscii(name, this,
          sink.writeByteArray(START_SLASH_TAG, this,
              sink.writeByteArrayB64(value, offset, length, this,
                  sink.writeByte(END_TAG, this,
                      sink.writeStrAscii(name, this,
                          sink.writeByte(START_TAG, this, tail)))))));
}
origin: protostuff/protostuff

private LinkedBuffer writeByteAndInt(byte b, int v, WriteSession session, LinkedBuffer lb)
    throws IOException
{
  return sink.writeInt32(v, session,
      sink.writeByte(b, session, lb));
}
origin: protostuff/protostuff

private LinkedBuffer writeByteAndLong(byte b, long v, WriteSession session, LinkedBuffer lb)
    throws IOException
{
  return sink.writeInt64(v, session,
      sink.writeByte(b, session, lb));
}
origin: protostuff/protostuff

@Override
public void writeBool(int fieldNumber, boolean value, boolean repeated) throws IOException
{
  final WriteSink sink = this.sink;
  if (lastNumber == fieldNumber)
  {
    // repeated field
    tail = sink.writeByteArray(
        value ? TRUE : FALSE,
        this,
        sink.writeByte(
            COMMA,
            this,
            tail));
    return;
  }
  tail = sink.writeByteArray(
      value ? TRUE : FALSE,
      this,
      writeKey(
          fieldNumber,
          sink,
          repeated ? KEY_SUFFIX_ARRAY : KEY_SUFFIX));
  lastNumber = fieldNumber;
  lastRepeated = repeated;
}
origin: protostuff/protostuff

@Override
public void writeInt64(int fieldNumber, long value, boolean repeated) throws IOException
{
  final String name = schema.getFieldName(fieldNumber);
  tail = sink.writeByte(END_TAG, this,
      sink.writeStrAscii(name, this,
          sink.writeByteArray(START_SLASH_TAG, this,
              sink.writeStrFromLong(value, this,
                  sink.writeByte(END_TAG, this,
                      sink.writeStrAscii(name, this,
                          sink.writeByte(START_TAG, this, tail)))))));
}
origin: protostuff/protostuff

@Override
public void writeString(int fieldNumber, CharSequence value, boolean repeated) throws IOException
{
  final String name = schema.getFieldName(fieldNumber);
  tail = sink.writeByte(END_TAG, this,
      sink.writeStrAscii(name, this,
          sink.writeByteArray(START_SLASH_TAG, this,
              sink.writeStrUTF8(value, this,
                  sink.writeByte(END_TAG, this,
                      sink.writeStrAscii(name, this,
                          sink.writeByte(START_TAG, this, tail)))))));
}
origin: protostuff/protostuff

@Override
public void writeDouble(int fieldNumber, double value, boolean repeated) throws IOException
{
  final String name = schema.getFieldName(fieldNumber);
  tail = sink.writeByte(END_TAG, this,
      sink.writeStrAscii(name, this,
          sink.writeByteArray(START_SLASH_TAG, this,
              sink.writeStrFromDouble(value, this,
                  sink.writeByte(END_TAG, this,
                      sink.writeStrAscii(name, this,
                          sink.writeByte(START_TAG, this, tail)))))));
}
origin: protostuff/protostuff

@Override
public void writeFloat(int fieldNumber, float value, boolean repeated) throws IOException
{
  final String name = schema.getFieldName(fieldNumber);
  tail = sink.writeByte(END_TAG, this,
      sink.writeStrAscii(name, this,
          sink.writeByteArray(START_SLASH_TAG, this,
              sink.writeStrFromFloat(value, this,
                  sink.writeByte(END_TAG, this,
                      sink.writeStrAscii(name, this,
                          sink.writeByte(START_TAG, this, tail)))))));
}
origin: protostuff/protostuff

JsonXOutput writeCommaAndStartObject() throws IOException
{
  tail = sink.writeByteArray(COMMA_AND_START_OBJECT, this, tail);
  return this;
}
origin: protostuff/protostuff

JsonXOutput writeEndObject() throws IOException
{
  tail = sink.writeByte(END_OBJECT, this, tail);
  return this;
}
origin: protostuff/protostuff

  numBuf[1] = (byte) ((len >>> 8) & 0xFF);
  lb = sink.writeStrFromInt(
      number,
      this,
      sink.writeByteArray(
          numBuf, 0, 2,
          this,
  numBuf[1] = (byte) ((valueLen >>> 8) & 0xFF);
  return sink.writeByteArray(numBuf, 0, 2, this, lb);
numBuf[1] = (byte) ((valueLen >>> 8) & 0xFF);
return sink.writeByteArray(
    numBuf, 0, 2,
    this,
    sink.writeStrUTF8FixedDelimited(
        schema.getFieldName(number),
        true,
origin: protostuff/protostuff

  tail = sink.writeByteArrayB64(
      value,
      this,
      sink.writeByteArray(
          DASH_AND_SPACE,
          this,
tail = sink.writeByteArrayB64(
    value,
    this,
origin: protostuff/protostuff

@Override
public void writeInt64(int fieldNumber, long value, boolean repeated) throws IOException
{
  final WriteSink sink = this.sink;
  if (lastNumber == fieldNumber)
  {
    // repeated field
    tail = sink.writeStrFromLong(
        value,
        this,
        sink.writeByte(
            COMMA,
            this,
            tail));
    return;
  }
  tail = sink.writeStrFromLong(
      value,
      this,
      writeKey(
          fieldNumber,
          sink,
          repeated ? KEY_SUFFIX_ARRAY : KEY_SUFFIX));
  lastNumber = fieldNumber;
  lastRepeated = repeated;
}
origin: protostuff/protostuff

@Override
public void writeInt32(int fieldNumber, int value, boolean repeated) throws IOException
{
  final WriteSink sink = this.sink;
  if (lastNumber == fieldNumber)
  {
    // repeated field
    tail = sink.writeStrFromInt(
        value,
        this,
        sink.writeByte(
            COMMA,
            this,
            tail));
    return;
  }
  tail = sink.writeStrFromInt(
      value,
      this,
      writeKey(
          fieldNumber,
          sink,
          repeated ? KEY_SUFFIX_ARRAY : KEY_SUFFIX));
  lastNumber = fieldNumber;
  lastRepeated = repeated;
}
origin: protostuff/protostuff

private static LinkedBuffer writeKey(final String name, final int indent,
    final boolean repeated, final WriteSink sink,
    final WriteSession session, LinkedBuffer lb) throws IOException
{
  lb = sink.writeByteArray(
      COLON_AND_SPACE,
      session,
      sink.writeStrAscii(
          name,
          session,
          newLine(
              indent,
              sink,
              session,
              lb)));
  if (repeated)
  {
    return sink.writeByteArray(
        DASH_AND_SPACE,
        session,
        newLine(
            inc(indent, 2),
            sink,
            session,
            lb));
  }
  return lb;
}
origin: protostuff/protostuff

@Override
public void writeDouble(int fieldNumber, double value, boolean repeated) throws IOException
{
  final WriteSink sink = this.sink;
  if (lastNumber == fieldNumber)
  {
    // repeated field
    tail = sink.writeStrFromDouble(
        value,
        this,
        sink.writeByte(
            COMMA,
            this,
            tail));
    return;
  }
  tail = sink.writeStrFromDouble(
      value,
      this,
      writeKey(
          fieldNumber,
          sink,
          repeated ? KEY_SUFFIX_ARRAY : KEY_SUFFIX));
  lastNumber = fieldNumber;
  lastRepeated = repeated;
}
origin: protostuff/protostuff

@Override
public void writeFloat(int fieldNumber, float value, boolean repeated) throws IOException
{
  final WriteSink sink = this.sink;
  if (lastNumber == fieldNumber)
  {
    // repeated field
    tail = sink.writeStrFromFloat(
        value,
        this,
        sink.writeByte(
            COMMA,
            this,
            tail));
    return;
  }
  tail = sink.writeStrFromFloat(
      value,
      this,
      writeKey(
          fieldNumber,
          sink,
          repeated ? KEY_SUFFIX_ARRAY : KEY_SUFFIX));
  lastNumber = fieldNumber;
  lastRepeated = repeated;
}
io.protostuffWriteSink

Javadoc

The flexible output for outputs that use WriteSession.

Most used methods

  • writeByteArray
  • writeByte
  • writeByteArrayB64
  • writeStrAscii
  • writeStrFromInt
  • writeStrFromLong
  • writeStrFromDouble
  • writeStrFromFloat
  • writeStrUTF8
  • drain
  • writeInt32
  • writeInt32LE
  • writeInt32,
  • writeInt32LE,
  • writeInt64,
  • writeInt64LE,
  • writeStrUTF8VarDelimited,
  • writeInt16,
  • writeStrUTF8FixedDelimited,
  • writeVarInt32,
  • writeVarInt64

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now