private void sendSaslMessage(ChannelHandlerContext ctx, byte[] payload, List<CipherOption> options) throws IOException { DataTransferEncryptorMessageProto.Builder builder = DataTransferEncryptorMessageProto.newBuilder(); builder.setStatus(DataTransferEncryptorStatus.SUCCESS); if (payload != null) { // Was ByteStringer; fix w/o using ByteStringer. Its in hbase-protocol // and we want to keep that out of hbase-server. builder.setPayload(ByteString.copyFrom(payload)); } if (options != null) { builder.addAllCipherOption(PB_HELPER.convertCipherOptions(options)); } DataTransferEncryptorMessageProto proto = builder.build(); int size = proto.getSerializedSize(); size += CodedOutputStream.computeRawVarint32Size(size); ByteBuf buf = ctx.alloc().buffer(size); proto.writeDelimitedTo(new ByteBufOutputStream(buf)); ctx.write(buf); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, status_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, payload_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, getMessageBytes()); } for (int i = 0; i < cipherOption_.size(); i++) { output.writeMessage(4, cipherOption_.get(i)); } getUnknownFields().writeTo(output); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, status_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, payload_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, getMessageBytes()); } for (int i = 0; i < cipherOption_.size(); i++) { output.writeMessage(4, cipherOption_.get(i)); } getUnknownFields().writeTo(output); }
public void writeTo(io.prestosql.hadoop.$internal.com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, status_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, payload_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, getMessageBytes()); } for (int i = 0; i < cipherOption_.size(); i++) { output.writeMessage(4, cipherOption_.get(i)); } getUnknownFields().writeTo(output); }