@Override public void writeTo(Output output, int number, ByteString value, boolean repeated) throws IOException { output.writeBytes(number, value, repeated); }
@Override public void writeTo(Output output, int number, ByteString value, boolean repeated) throws IOException { output.writeBytes(number, value, repeated); }
@Override public void writeTo(Output output, int number, ByteString value, boolean repeated) throws IOException { output.writeBytes(number, value, repeated); }
@Override public void writeBytes(int fieldNumber, ByteString value, boolean repeated) throws IOException { output.writeBytes(fieldNumber, value, repeated); }
@Override public void transferByteRangeTo(Output output, boolean utf8String, int fieldNumber, boolean repeated) throws IOException { final int length = readRawVarInt32(); if (length < 0) { throw ProtocolException.negativeSize(); } if (utf8String) { // if it is a UTF string, we have to call the writeByteRange. if (nioBuffer.hasArray()) { output.writeByteRange(true, fieldNumber, nioBuffer.array(), nioBuffer.arrayOffset() + nioBuffer.position(), length, repeated); nioBuffer.position(nioBuffer.position() + length); } else { byte[] bytes = new byte[length]; nioBuffer.get(bytes); output.writeByteRange(true, fieldNumber, bytes, 0, bytes.length, repeated); } } else { // Do the potentially vastly more efficient potential splice call. if (nioBuffer.remaining() < length) { throw ProtocolException.misreportedSize(); } ByteBuffer dup = nioBuffer.slice(); dup.limit(length); output.writeBytes(fieldNumber, dup, repeated); nioBuffer.position(nioBuffer.position() + length); } }
@Override public void transferByteRangeTo(Output output, boolean utf8String, int fieldNumber, boolean repeated) throws IOException { final int length = readRawVarInt32(); if (length < 0) { throw ProtocolException.negativeSize(); } if (utf8String) { // if it is a UTF string, we have to call the writeByteRange. if (nioBuffer.hasArray()) { output.writeByteRange(true, fieldNumber, nioBuffer.array(), nioBuffer.arrayOffset() + nioBuffer.position(), length, repeated); nioBuffer.position(nioBuffer.position() + length); } else { byte[] bytes = new byte[length]; nioBuffer.get(bytes); output.writeByteRange(true, fieldNumber, bytes, 0, bytes.length, repeated); } } else { // Do the potentially vastly more efficient potential splice call. if (nioBuffer.remaining() < length) { throw ProtocolException.misreportedSize(); } ByteBuffer dup = nioBuffer.slice(); dup.limit(length); output.writeBytes(fieldNumber, dup, repeated); nioBuffer.position(nioBuffer.position() + length); } }
dup.limit(length); output.writeBytes(fieldNumber, dup, repeated);
dup.limit(length); output.writeBytes(fieldNumber, dup, repeated);
dup.limit(length); output.writeBytes(fieldNumber, dup, repeated);
@Override public void writeTo(Output output, Object value) throws IOException { ByteString[] array = (ByteString[]) value; output.writeInt32(ID_ARRAY_LEN, array.length, false); int nullCount = 0; for (int i = 0, len = array.length; i < len; i++) { ByteString v = array[i]; if (v != null) { if (nullCount != 0) { output.writeUInt32(ID_ARRAY_NULLCOUNT, nullCount, false); nullCount = 0; } output.writeBytes(ID_ARRAY_DATA, v, true); } else if (allowNullArrayElement) { nullCount++; } } // if last element is null if (nullCount != 0) output.writeUInt32(ID_ARRAY_NULLCOUNT, nullCount, false); } }
@Override public void writeTo(Output output, Object value) throws IOException { ByteString[] array = (ByteString[]) value; output.writeInt32(ID_ARRAY_LEN, array.length, false); int nullCount = 0; for (int i = 0, len = array.length; i < len; i++) { ByteString v = array[i]; if (v != null) { if (nullCount != 0) { output.writeUInt32(ID_ARRAY_NULLCOUNT, nullCount, false); nullCount = 0; } output.writeBytes(ID_ARRAY_DATA, v, true); } else if (allowNullArrayElement) { nullCount++; } } // if last element is null if (nullCount != 0) output.writeUInt32(ID_ARRAY_NULLCOUNT, nullCount, false); } }
@Override public void writeTo(Output output, Bar message) throws IOException { if (message.someInt != 0) output.writeInt32(1, message.someInt, false); if (message.someString != null) output.writeString(2, message.someString, false); if (message.someBaz != null) output.writeObject(3, message.someBaz, Baz.getSchema(), false); if (message.someEnum != null) output.writeEnum(4, message.someEnum.number, false); if (message.someBytes != null) output.writeBytes(5, message.someBytes, false); if (message.someBoolean) output.writeBool(6, message.someBoolean, false); if (message.someFloat != 0f) output.writeFloat(7, message.someFloat, false); if (message.someDouble != 0d) output.writeDouble(8, message.someDouble, false); if (message.someLong != 0l) output.writeInt64(9, message.someLong, false); }
output.writeBytes(5, value, true);
public void writeTo(Output output, PreparedStatementHandle message) throws IOException { if(message.serverInfo != null) output.writeBytes(1, message.serverInfo, false); }
public void writeTo(Output output, UserAuth message) throws IOException { if(message.uid != null) output.writeObject(1, message.uid, UID.getSchema(), false); if(message.prefix != null) output.writeBytes(2, message.prefix, false); if(message.authKey != null) output.writeBytes(3, message.authKey, false); }
public void writeTo(Output output, ExtraInfo message) throws IOException { if(message.name != null) output.writeString(1, message.name, false); if(message.data != null) output.writeBytes(2, message.data, false); }
public void writeTo(Output output, CompleteRpcMessage message) throws IOException { if(message.header != null) output.writeObject(1, message.header, RpcHeader.getSchema(), false); if(message.protobufBody != null) output.writeBytes(2, message.protobufBody, false); if(message.rawBody != null) output.writeBytes(3, message.rawBody, false); }
public void writeTo(Output output, SchedulingInfo message) throws IOException { if(message.queueId != null) output.writeString(1, message.queueId, false); if(message.workloadClass != null) output.writeEnum(2, message.workloadClass.number, false); if(message.additionalInfo != null) output.writeBytes(3, message.additionalInfo, false); }
public void writeTo(Output output, ConfigurationEntry message) throws IOException { if(message.type != null) output.writeString(1, message.type, false); if(message.value != null) output.writeBytes(2, message.value, false); if(message.version != null) output.writeInt64(3, message.version, false); if(message.tag != null) output.writeString(4, message.tag, false); }
public void writeTo(Output output, SharedData message) throws IOException { if(message.majorFragmentId != 0) output.writeInt32(1, message.majorFragmentId, false); if(message.operatorId != 0) output.writeInt32(2, message.operatorId, false); if(message.name != null) output.writeString(3, message.name, false); if(message.value != null) output.writeBytes(4, message.value, false); }