@Override public void write(byte[] b, int off, int len) throws IOException { session.sink.writeByteArray(b, off, len, session, session.head); }
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))))))); }
JsonXOutput writeCommaAndStartObject() throws IOException { tail = sink.writeByteArray(COMMA_AND_START_OBJECT, this, tail); return this; }
public JniStream write(byte[] value) throws IOException { if(0 == value.length) { tail = sink.writeByteArray(EMPTY_BYTES, this, tail); return this; } return write(value, 0, value.length); }
public JniStream writeString(byte[] value) throws IOException { if(0 == value.length) { tail = sink.writeByteArray(EMPTY_BYTES, this, tail); return this; } return writeString(value, 0, value.length); }
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; }
YamlOutput writeSequenceDelim() throws IOException { tail = sink.writeByteArray( DASH_AND_SPACE, this, newLine( indent, sink, this, tail)); indent = inc(indent, 2); return this; }
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; }
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; }
/** * Appends a raw byte array. */ public KeyBuilder $append(byte[] value, int offset, int len) { try { if(head != sink.writeByteArray(value, offset, len, this, tail)) throw bo(); } catch (IOException e) { throw snh(); } return this; }
public void writeBool(int fieldNumber, boolean 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.writeByteArray(value ? TRUE : FALSE, this, sink.writeByte(END_TAG, this, sink.writeStrAscii(name, this, sink.writeByte(START_TAG, this, tail))))))); }
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))); }
/** * Appends a byte array. */ public KeyBuilder append(byte[] value, int offset, int len) { try { if(head != sink.writeByte((byte)0, this, sink.writeByteArray(value, offset, len, this, tail))) throw bo(); } catch (IOException e) { throw snh(); } return this; }
public JniStream writeKVAO(byte[] k, int koffset, int klen, int kvAbsoluteOffset) throws IOException { previousOffset = head.offset; sink.writeByteArray(k, koffset, klen, this, sink.writeInt16LE(kvAbsoluteOffset, this, sink.writeInt16LE(klen, this, sink.writeByte((byte)WIRETYPE_KVAO, this, head)))); return this; }
public static void writeYamlTo(WriteSession session, WriteContext context, final byte[] key, final EntityMetadata<Object> em, byte[] outPrefix, String errMsg) throws IOException { session.sink.writeByteArray(outPrefix, session, session.head); try { YamlIOUtil.writeTo(new WriteSessionOutputStream(session), errMsg, RpcService.STATUS_MSG_SCHEMA, context.lb); } finally { context.lb.clear(); } }
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 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 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))))))); }