@Override public void writeByteArray(int fieldNumber, byte[] value, boolean repeated) throws IOException { output.writeByteArray(fieldNumber, value, repeated); }
/** * Writes the bytes to the {@link Output}. */ public static void writeTo(Output output, ByteString bs, int fieldNumber, boolean repeated) throws IOException { output.writeByteArray(fieldNumber, bs.bytes, repeated); }
@Override public void writeTo(Output output, int number, byte[] value, boolean repeated) throws IOException { output.writeByteArray(number, value, repeated); }
@Override public void writeTo(Output output, int number, byte[] value, boolean repeated) throws IOException { output.writeByteArray(number, value, repeated); }
@Override public void writeTo(Output output, int number, byte[] value, boolean repeated) throws IOException { output.writeByteArray(number, value, repeated); }
@Override public void writeTo(Output output, int number, BigInteger value, boolean repeated) throws IOException { output.writeByteArray(number, value.toByteArray(), repeated); }
@Override public void writeTo(Output output, int number, BigInteger value, boolean repeated) throws IOException { output.writeByteArray(number, value.toByteArray(), repeated); }
@Override public void writeTo(Output output, int number, BigInteger value, boolean repeated) throws IOException { output.writeByteArray(number, value.toByteArray(), repeated); }
@Override public void writeTo(Output output, int number, short[] value, boolean repeated) throws IOException { writes++; byte[] buffer = new byte[value.length * 2]; for (int i = 0, offset = 0; i < value.length; i++) { short s = value[i]; buffer[offset++] = (byte) ((s >>> 8) & 0xFF); buffer[offset++] = (byte) ((s >>> 0) & 0xFF); } output.writeByteArray(number, buffer, repeated); }
static void writeHasBar(Output output, int fieldNumber, HasBar hasBar, boolean repeated) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(4096); ObjectOutputStream oos = new ObjectOutputStream(baos); try { oos.writeObject(hasBar); output.writeByteArray(fieldNumber, baos.toByteArray(), repeated); } finally { oos.close(); } }
@Override public void transferByteRangeTo(Output output, boolean utf8String, int fieldNumber, boolean repeated) throws IOException { if (utf8String) output.writeString(fieldNumber, readString(), repeated); else output.writeByteArray(fieldNumber, readByteArray(), repeated); }
@Override public void transferByteRangeTo(Output output, boolean utf8String, int fieldNumber, boolean repeated) throws IOException { if (utf8String) { output.writeString(fieldNumber, readString(), repeated); } else { output.writeByteArray(fieldNumber, readByteArray(), repeated); } }
@Override public void transferByteRangeTo(Output output, boolean utf8String, int fieldNumber, boolean repeated) throws IOException { if (utf8String) output.writeString(fieldNumber, readString(), repeated); else output.writeByteArray(fieldNumber, readByteArray(), repeated); }
@Override public void writeTo(Output output, Object value) throws IOException { BigInteger[] array = (BigInteger[]) value; output.writeInt32(ID_ARRAY_LEN, array.length, false); int nullCount = 0; for (int i = 0, len = array.length; i < len; i++) { BigInteger v = array[i]; if (v != null) { if (nullCount != 0) { output.writeUInt32(ID_ARRAY_NULLCOUNT, nullCount, false); nullCount = 0; } output.writeByteArray(ID_ARRAY_DATA, v.toByteArray(), 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 { BigInteger[] array = (BigInteger[]) value; output.writeInt32(ID_ARRAY_LEN, array.length, false); int nullCount = 0; for (int i = 0, len = array.length; i < len; i++) { BigInteger v = array[i]; if (v != null) { if (nullCount != 0) { output.writeUInt32(ID_ARRAY_NULLCOUNT, nullCount, false); nullCount = 0; } output.writeByteArray(ID_ARRAY_DATA, v.toByteArray(), 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 { byte[][] array = (byte[][]) value; output.writeInt32(ID_ARRAY_LEN, array.length, false); int nullCount = 0; for (int i = 0, len = array.length; i < len; i++) { byte[] v = array[i]; if (v != null) { if (nullCount != 0) { output.writeUInt32(ID_ARRAY_NULLCOUNT, nullCount, false); nullCount = 0; } output.writeByteArray(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 { byte[][] array = (byte[][]) value; output.writeInt32(ID_ARRAY_LEN, array.length, false); int nullCount = 0; for (int i = 0, len = array.length; i < len; i++) { byte[] v = array[i]; if (v != null) { if (nullCount != 0) { output.writeUInt32(ID_ARRAY_NULLCOUNT, nullCount, false); nullCount = 0; } output.writeByteArray(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, PojoWithBiggerByteArray message) throws IOException { output.writeInt32(1, message.id, false); output.writeByteArray(2, message.b, false); output.writeInt64(3, message.ts, false); }
@Override public void writeTo(Output output, int number, Object value, boolean repeated) throws IOException { output.writeByteArray(number, JsonUtils.writeValueAsBytes(value), false); }
public void writeTo(io.protostuff.Output output, com.dremio.exec.proto.GeneralRPCProtos.CompleteRpcMessage message) throws java.io.IOException { if(message.hasHeader()) output.writeObject(1, message.getHeader(), com.dremio.exec.proto.SchemaGeneralRPCProtos.RpcHeader.WRITE, false); if(message.hasProtobufBody()) output.writeByteArray(2, message.getProtobufBody().toByteArray(), false); if(message.hasRawBody()) output.writeByteArray(3, message.getRawBody().toByteArray(), false); } public boolean isInitialized(com.dremio.exec.proto.GeneralRPCProtos.CompleteRpcMessage message)