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; }
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))))))); }
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))))))); }
public JniStream write64(long value) throws IOException { tail = sink.writeInt64LE( value, this, sink.writeByte( (byte)WIRETYPE_UINT64, this, tail)); return this; }
public JniStream writeK(byte[] k, int koffset, int klen) throws IOException { previousOffset = head.offset; sink.writeByteArray(k, koffset, klen, this, sink.writeByte((byte)klen, this, sink.writeByte((byte)WIRETYPE_K, this, head))); return this; }
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,
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))))))); }
public void writeString(int fieldNumber, String 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))))))); }
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))))))); }
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))))))); }
public JniStream write(byte[] value, int offset, int len) throws IOException { tail = sink.writeByteArray( value, offset, len, this, sink.writeInt16LE( len, this, sink.writeByte( (byte)WIRETYPE_BYTES, this, tail))); return this; }
JsonXOutput writeStartArray() throws IOException { tail = sink.writeByte(START_ARRAY, this, tail); return this; }
@Override public void write(byte[] b, int off, int len) throws IOException { session.sink.writeByteArray(b, off, len, session, session.head); }
public JniStream writeString(String value) throws IOException { if(0 == value.length()) { tail = sink.writeByteArray(EMPTY_STRING, this, tail); return this; } tail = sink.writeByte( (byte)0, // null character this, sink.writeStrUTF8FixedDelimited( value, true, this, sink.writeByte( (byte)WIRETYPE_STRING, this, tail))); return this; }
public void writeByteRange(boolean utf8String, int fieldNumber, byte[] value, int offset, int length, boolean repeated) throws IOException { tail = sink.writeByteArray( value, offset, length, this, sink.writeVarInt32( length, this, sink.writeVarInt32( makeTag(fieldNumber, WIRETYPE_LENGTH_DELIMITED), this, tail))); }
tail = sink.writeByteArrayB64( value, this, sink.writeByteArray( DASH_AND_SPACE, this, tail = sink.writeByteArrayB64( value, this,
tail = sink.writeInt64LE( value, this, sink.writeVarInt32( makeTag(fieldNumber, WIRETYPE_FIXED64), this, tail = sink.writeByteArray(input.buffer,
public void writeBool(int fieldNumber, boolean value, boolean repeated) throws IOException { tail = sink.writeByte( value ? (byte)0x01 : 0x00, this, sink.writeVarInt32( makeTag(fieldNumber, WIRETYPE_VARINT), this, tail)); /*tail = writeTagAndRawVarInt32( makeTag(fieldNumber, WIRETYPE_VARINT), value ? 1 : 0, this, tail);*/ }
/** * Apppends a string, no lower case. */ public KeyBuilder appendNOLC(String value) { try { if(head != sink.writeByte((byte)0, this, sink.writeStrUTF8(value, this, tail))) throw bo(); } catch (IOException e) { throw snh(); } return this; }
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; }