All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.diozero.remote.message.protobuf.Serial Maven / Gradle / Ivy

The newest version!
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: diozero.proto
// Protobuf Java Version: 4.28.2

package com.diozero.remote.message.protobuf;

/**
 * Protobuf type {@code diozero.Serial}
 */
public final class Serial extends
    com.google.protobuf.GeneratedMessage implements
    // @@protoc_insertion_point(message_implements:diozero.Serial)
    SerialOrBuilder {
private static final long serialVersionUID = 0L;
  static {
    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
      /* major= */ 4,
      /* minor= */ 28,
      /* patch= */ 2,
      /* suffix= */ "",
      Serial.class.getName());
  }
  // Use Serial.newBuilder() to construct.
  private Serial(com.google.protobuf.GeneratedMessage.Builder builder) {
    super(builder);
  }
  private Serial() {
  }

  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.diozero.remote.message.protobuf.Serial.class, com.diozero.remote.message.protobuf.Serial.Builder.class);
  }

  public interface IdentifierOrBuilder extends
      // @@protoc_insertion_point(interface_extends:diozero.Serial.Identifier)
      com.google.protobuf.MessageOrBuilder {

    /**
     * string deviceFile = 1;
     * @return The deviceFile.
     */
    java.lang.String getDeviceFile();
    /**
     * string deviceFile = 1;
     * @return The bytes for deviceFile.
     */
    com.google.protobuf.ByteString
        getDeviceFileBytes();
  }
  /**
   * Protobuf type {@code diozero.Serial.Identifier}
   */
  public static final class Identifier extends
      com.google.protobuf.GeneratedMessage implements
      // @@protoc_insertion_point(message_implements:diozero.Serial.Identifier)
      IdentifierOrBuilder {
  private static final long serialVersionUID = 0L;
    static {
      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        /* major= */ 4,
        /* minor= */ 28,
        /* patch= */ 2,
        /* suffix= */ "",
        Identifier.class.getName());
    }
    // Use Identifier.newBuilder() to construct.
    private Identifier(com.google.protobuf.GeneratedMessage.Builder builder) {
      super(builder);
    }
    private Identifier() {
      deviceFile_ = "";
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_Identifier_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_Identifier_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.diozero.remote.message.protobuf.Serial.Identifier.class, com.diozero.remote.message.protobuf.Serial.Identifier.Builder.class);
    }

    public static final int DEVICEFILE_FIELD_NUMBER = 1;
    @SuppressWarnings("serial")
    private volatile java.lang.Object deviceFile_ = "";
    /**
     * string deviceFile = 1;
     * @return The deviceFile.
     */
    @java.lang.Override
    public java.lang.String getDeviceFile() {
      java.lang.Object ref = deviceFile_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        deviceFile_ = s;
        return s;
      }
    }
    /**
     * string deviceFile = 1;
     * @return The bytes for deviceFile.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDeviceFileBytes() {
      java.lang.Object ref = deviceFile_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        deviceFile_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    private byte memoizedIsInitialized = -1;
    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceFile_)) {
        com.google.protobuf.GeneratedMessage.writeString(output, 1, deviceFile_);
      }
      getUnknownFields().writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceFile_)) {
        size += com.google.protobuf.GeneratedMessage.computeStringSize(1, deviceFile_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof com.diozero.remote.message.protobuf.Serial.Identifier)) {
        return super.equals(obj);
      }
      com.diozero.remote.message.protobuf.Serial.Identifier other = (com.diozero.remote.message.protobuf.Serial.Identifier) obj;

      if (!getDeviceFile()
          .equals(other.getDeviceFile())) return false;
      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + DEVICEFILE_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceFile().hashCode();
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.diozero.remote.message.protobuf.Serial.Identifier parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.Identifier parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.Identifier parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.Identifier parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.Identifier parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.Identifier parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.Identifier parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input);
    }
    public static com.diozero.remote.message.protobuf.Serial.Identifier parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static com.diozero.remote.message.protobuf.Serial.Identifier parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseDelimitedWithIOException(PARSER, input);
    }

    public static com.diozero.remote.message.protobuf.Serial.Identifier parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.Identifier parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input);
    }
    public static com.diozero.remote.message.protobuf.Serial.Identifier parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(com.diozero.remote.message.protobuf.Serial.Identifier prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code diozero.Serial.Identifier}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder implements
        // @@protoc_insertion_point(builder_implements:diozero.Serial.Identifier)
        com.diozero.remote.message.protobuf.Serial.IdentifierOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_Identifier_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_Identifier_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.diozero.remote.message.protobuf.Serial.Identifier.class, com.diozero.remote.message.protobuf.Serial.Identifier.Builder.class);
      }

      // Construct using com.diozero.remote.message.protobuf.Serial.Identifier.newBuilder()
      private Builder() {

      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);

      }
      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        deviceFile_ = "";
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_Identifier_descriptor;
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.Identifier getDefaultInstanceForType() {
        return com.diozero.remote.message.protobuf.Serial.Identifier.getDefaultInstance();
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.Identifier build() {
        com.diozero.remote.message.protobuf.Serial.Identifier result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.Identifier buildPartial() {
        com.diozero.remote.message.protobuf.Serial.Identifier result = new com.diozero.remote.message.protobuf.Serial.Identifier(this);
        if (bitField0_ != 0) { buildPartial0(result); }
        onBuilt();
        return result;
      }

      private void buildPartial0(com.diozero.remote.message.protobuf.Serial.Identifier result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.deviceFile_ = deviceFile_;
        }
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.diozero.remote.message.protobuf.Serial.Identifier) {
          return mergeFrom((com.diozero.remote.message.protobuf.Serial.Identifier)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.diozero.remote.message.protobuf.Serial.Identifier other) {
        if (other == com.diozero.remote.message.protobuf.Serial.Identifier.getDefaultInstance()) return this;
        if (!other.getDeviceFile().isEmpty()) {
          deviceFile_ = other.deviceFile_;
          bitField0_ |= 0x00000001;
          onChanged();
        }
        this.mergeUnknownFields(other.getUnknownFields());
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 10: {
                deviceFile_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
              default: {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
            } // switch (tag)
          } // while (!done)
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.unwrapIOException();
        } finally {
          onChanged();
        } // finally
        return this;
      }
      private int bitField0_;

      private java.lang.Object deviceFile_ = "";
      /**
       * string deviceFile = 1;
       * @return The deviceFile.
       */
      public java.lang.String getDeviceFile() {
        java.lang.Object ref = deviceFile_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          deviceFile_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * string deviceFile = 1;
       * @return The bytes for deviceFile.
       */
      public com.google.protobuf.ByteString
          getDeviceFileBytes() {
        java.lang.Object ref = deviceFile_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          deviceFile_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * string deviceFile = 1;
       * @param value The deviceFile to set.
       * @return This builder for chaining.
       */
      public Builder setDeviceFile(
          java.lang.String value) {
        if (value == null) { throw new NullPointerException(); }
        deviceFile_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       * string deviceFile = 1;
       * @return This builder for chaining.
       */
      public Builder clearDeviceFile() {
        deviceFile_ = getDefaultInstance().getDeviceFile();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }
      /**
       * string deviceFile = 1;
       * @param value The bytes for deviceFile to set.
       * @return This builder for chaining.
       */
      public Builder setDeviceFileBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) { throw new NullPointerException(); }
        checkByteStringIsUtf8(value);
        deviceFile_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:diozero.Serial.Identifier)
    }

    // @@protoc_insertion_point(class_scope:diozero.Serial.Identifier)
    private static final com.diozero.remote.message.protobuf.Serial.Identifier DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new com.diozero.remote.message.protobuf.Serial.Identifier();
    }

    public static com.diozero.remote.message.protobuf.Serial.Identifier getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser
        PARSER = new com.google.protobuf.AbstractParser() {
      @java.lang.Override
      public Identifier parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        Builder builder = newBuilder();
        try {
          builder.mergeFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.setUnfinishedMessage(builder.buildPartial());
        } catch (com.google.protobuf.UninitializedMessageException e) {
          throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
        } catch (java.io.IOException e) {
          throw new com.google.protobuf.InvalidProtocolBufferException(e)
              .setUnfinishedMessage(builder.buildPartial());
        }
        return builder.buildPartial();
      }
    };

    public static com.google.protobuf.Parser parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.diozero.remote.message.protobuf.Serial.Identifier getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface OpenOrBuilder extends
      // @@protoc_insertion_point(interface_extends:diozero.Serial.Open)
      com.google.protobuf.MessageOrBuilder {

    /**
     * string deviceFile = 1;
     * @return The deviceFile.
     */
    java.lang.String getDeviceFile();
    /**
     * string deviceFile = 1;
     * @return The bytes for deviceFile.
     */
    com.google.protobuf.ByteString
        getDeviceFileBytes();

    /**
     * int32 baud = 2;
     * @return The baud.
     */
    int getBaud();

    /**
     * int32 dataBits = 3;
     * @return The dataBits.
     */
    int getDataBits();

    /**
     * int32 stopBits = 4;
     * @return The stopBits.
     */
    int getStopBits();

    /**
     * int32 parity = 5;
     * @return The parity.
     */
    int getParity();

    /**
     * bool readBlocking = 6;
     * @return The readBlocking.
     */
    boolean getReadBlocking();

    /**
     * int32 minReadChars = 7;
     * @return The minReadChars.
     */
    int getMinReadChars();

    /**
     * int32 readTimeoutMillis = 8;
     * @return The readTimeoutMillis.
     */
    int getReadTimeoutMillis();
  }
  /**
   * Protobuf type {@code diozero.Serial.Open}
   */
  public static final class Open extends
      com.google.protobuf.GeneratedMessage implements
      // @@protoc_insertion_point(message_implements:diozero.Serial.Open)
      OpenOrBuilder {
  private static final long serialVersionUID = 0L;
    static {
      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        /* major= */ 4,
        /* minor= */ 28,
        /* patch= */ 2,
        /* suffix= */ "",
        Open.class.getName());
    }
    // Use Open.newBuilder() to construct.
    private Open(com.google.protobuf.GeneratedMessage.Builder builder) {
      super(builder);
    }
    private Open() {
      deviceFile_ = "";
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_Open_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_Open_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.diozero.remote.message.protobuf.Serial.Open.class, com.diozero.remote.message.protobuf.Serial.Open.Builder.class);
    }

    public static final int DEVICEFILE_FIELD_NUMBER = 1;
    @SuppressWarnings("serial")
    private volatile java.lang.Object deviceFile_ = "";
    /**
     * string deviceFile = 1;
     * @return The deviceFile.
     */
    @java.lang.Override
    public java.lang.String getDeviceFile() {
      java.lang.Object ref = deviceFile_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        deviceFile_ = s;
        return s;
      }
    }
    /**
     * string deviceFile = 1;
     * @return The bytes for deviceFile.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDeviceFileBytes() {
      java.lang.Object ref = deviceFile_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        deviceFile_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int BAUD_FIELD_NUMBER = 2;
    private int baud_ = 0;
    /**
     * int32 baud = 2;
     * @return The baud.
     */
    @java.lang.Override
    public int getBaud() {
      return baud_;
    }

    public static final int DATABITS_FIELD_NUMBER = 3;
    private int dataBits_ = 0;
    /**
     * int32 dataBits = 3;
     * @return The dataBits.
     */
    @java.lang.Override
    public int getDataBits() {
      return dataBits_;
    }

    public static final int STOPBITS_FIELD_NUMBER = 4;
    private int stopBits_ = 0;
    /**
     * int32 stopBits = 4;
     * @return The stopBits.
     */
    @java.lang.Override
    public int getStopBits() {
      return stopBits_;
    }

    public static final int PARITY_FIELD_NUMBER = 5;
    private int parity_ = 0;
    /**
     * int32 parity = 5;
     * @return The parity.
     */
    @java.lang.Override
    public int getParity() {
      return parity_;
    }

    public static final int READBLOCKING_FIELD_NUMBER = 6;
    private boolean readBlocking_ = false;
    /**
     * bool readBlocking = 6;
     * @return The readBlocking.
     */
    @java.lang.Override
    public boolean getReadBlocking() {
      return readBlocking_;
    }

    public static final int MINREADCHARS_FIELD_NUMBER = 7;
    private int minReadChars_ = 0;
    /**
     * int32 minReadChars = 7;
     * @return The minReadChars.
     */
    @java.lang.Override
    public int getMinReadChars() {
      return minReadChars_;
    }

    public static final int READTIMEOUTMILLIS_FIELD_NUMBER = 8;
    private int readTimeoutMillis_ = 0;
    /**
     * int32 readTimeoutMillis = 8;
     * @return The readTimeoutMillis.
     */
    @java.lang.Override
    public int getReadTimeoutMillis() {
      return readTimeoutMillis_;
    }

    private byte memoizedIsInitialized = -1;
    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceFile_)) {
        com.google.protobuf.GeneratedMessage.writeString(output, 1, deviceFile_);
      }
      if (baud_ != 0) {
        output.writeInt32(2, baud_);
      }
      if (dataBits_ != 0) {
        output.writeInt32(3, dataBits_);
      }
      if (stopBits_ != 0) {
        output.writeInt32(4, stopBits_);
      }
      if (parity_ != 0) {
        output.writeInt32(5, parity_);
      }
      if (readBlocking_ != false) {
        output.writeBool(6, readBlocking_);
      }
      if (minReadChars_ != 0) {
        output.writeInt32(7, minReadChars_);
      }
      if (readTimeoutMillis_ != 0) {
        output.writeInt32(8, readTimeoutMillis_);
      }
      getUnknownFields().writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceFile_)) {
        size += com.google.protobuf.GeneratedMessage.computeStringSize(1, deviceFile_);
      }
      if (baud_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(2, baud_);
      }
      if (dataBits_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(3, dataBits_);
      }
      if (stopBits_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(4, stopBits_);
      }
      if (parity_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(5, parity_);
      }
      if (readBlocking_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(6, readBlocking_);
      }
      if (minReadChars_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(7, minReadChars_);
      }
      if (readTimeoutMillis_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(8, readTimeoutMillis_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof com.diozero.remote.message.protobuf.Serial.Open)) {
        return super.equals(obj);
      }
      com.diozero.remote.message.protobuf.Serial.Open other = (com.diozero.remote.message.protobuf.Serial.Open) obj;

      if (!getDeviceFile()
          .equals(other.getDeviceFile())) return false;
      if (getBaud()
          != other.getBaud()) return false;
      if (getDataBits()
          != other.getDataBits()) return false;
      if (getStopBits()
          != other.getStopBits()) return false;
      if (getParity()
          != other.getParity()) return false;
      if (getReadBlocking()
          != other.getReadBlocking()) return false;
      if (getMinReadChars()
          != other.getMinReadChars()) return false;
      if (getReadTimeoutMillis()
          != other.getReadTimeoutMillis()) return false;
      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + DEVICEFILE_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceFile().hashCode();
      hash = (37 * hash) + BAUD_FIELD_NUMBER;
      hash = (53 * hash) + getBaud();
      hash = (37 * hash) + DATABITS_FIELD_NUMBER;
      hash = (53 * hash) + getDataBits();
      hash = (37 * hash) + STOPBITS_FIELD_NUMBER;
      hash = (53 * hash) + getStopBits();
      hash = (37 * hash) + PARITY_FIELD_NUMBER;
      hash = (53 * hash) + getParity();
      hash = (37 * hash) + READBLOCKING_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getReadBlocking());
      hash = (37 * hash) + MINREADCHARS_FIELD_NUMBER;
      hash = (53 * hash) + getMinReadChars();
      hash = (37 * hash) + READTIMEOUTMILLIS_FIELD_NUMBER;
      hash = (53 * hash) + getReadTimeoutMillis();
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.diozero.remote.message.protobuf.Serial.Open parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.Open parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.Open parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.Open parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.Open parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.Open parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.Open parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input);
    }
    public static com.diozero.remote.message.protobuf.Serial.Open parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static com.diozero.remote.message.protobuf.Serial.Open parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseDelimitedWithIOException(PARSER, input);
    }

    public static com.diozero.remote.message.protobuf.Serial.Open parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.Open parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input);
    }
    public static com.diozero.remote.message.protobuf.Serial.Open parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(com.diozero.remote.message.protobuf.Serial.Open prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code diozero.Serial.Open}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder implements
        // @@protoc_insertion_point(builder_implements:diozero.Serial.Open)
        com.diozero.remote.message.protobuf.Serial.OpenOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_Open_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_Open_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.diozero.remote.message.protobuf.Serial.Open.class, com.diozero.remote.message.protobuf.Serial.Open.Builder.class);
      }

      // Construct using com.diozero.remote.message.protobuf.Serial.Open.newBuilder()
      private Builder() {

      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);

      }
      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        deviceFile_ = "";
        baud_ = 0;
        dataBits_ = 0;
        stopBits_ = 0;
        parity_ = 0;
        readBlocking_ = false;
        minReadChars_ = 0;
        readTimeoutMillis_ = 0;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_Open_descriptor;
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.Open getDefaultInstanceForType() {
        return com.diozero.remote.message.protobuf.Serial.Open.getDefaultInstance();
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.Open build() {
        com.diozero.remote.message.protobuf.Serial.Open result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.Open buildPartial() {
        com.diozero.remote.message.protobuf.Serial.Open result = new com.diozero.remote.message.protobuf.Serial.Open(this);
        if (bitField0_ != 0) { buildPartial0(result); }
        onBuilt();
        return result;
      }

      private void buildPartial0(com.diozero.remote.message.protobuf.Serial.Open result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.deviceFile_ = deviceFile_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.baud_ = baud_;
        }
        if (((from_bitField0_ & 0x00000004) != 0)) {
          result.dataBits_ = dataBits_;
        }
        if (((from_bitField0_ & 0x00000008) != 0)) {
          result.stopBits_ = stopBits_;
        }
        if (((from_bitField0_ & 0x00000010) != 0)) {
          result.parity_ = parity_;
        }
        if (((from_bitField0_ & 0x00000020) != 0)) {
          result.readBlocking_ = readBlocking_;
        }
        if (((from_bitField0_ & 0x00000040) != 0)) {
          result.minReadChars_ = minReadChars_;
        }
        if (((from_bitField0_ & 0x00000080) != 0)) {
          result.readTimeoutMillis_ = readTimeoutMillis_;
        }
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.diozero.remote.message.protobuf.Serial.Open) {
          return mergeFrom((com.diozero.remote.message.protobuf.Serial.Open)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.diozero.remote.message.protobuf.Serial.Open other) {
        if (other == com.diozero.remote.message.protobuf.Serial.Open.getDefaultInstance()) return this;
        if (!other.getDeviceFile().isEmpty()) {
          deviceFile_ = other.deviceFile_;
          bitField0_ |= 0x00000001;
          onChanged();
        }
        if (other.getBaud() != 0) {
          setBaud(other.getBaud());
        }
        if (other.getDataBits() != 0) {
          setDataBits(other.getDataBits());
        }
        if (other.getStopBits() != 0) {
          setStopBits(other.getStopBits());
        }
        if (other.getParity() != 0) {
          setParity(other.getParity());
        }
        if (other.getReadBlocking() != false) {
          setReadBlocking(other.getReadBlocking());
        }
        if (other.getMinReadChars() != 0) {
          setMinReadChars(other.getMinReadChars());
        }
        if (other.getReadTimeoutMillis() != 0) {
          setReadTimeoutMillis(other.getReadTimeoutMillis());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 10: {
                deviceFile_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
              case 16: {
                baud_ = input.readInt32();
                bitField0_ |= 0x00000002;
                break;
              } // case 16
              case 24: {
                dataBits_ = input.readInt32();
                bitField0_ |= 0x00000004;
                break;
              } // case 24
              case 32: {
                stopBits_ = input.readInt32();
                bitField0_ |= 0x00000008;
                break;
              } // case 32
              case 40: {
                parity_ = input.readInt32();
                bitField0_ |= 0x00000010;
                break;
              } // case 40
              case 48: {
                readBlocking_ = input.readBool();
                bitField0_ |= 0x00000020;
                break;
              } // case 48
              case 56: {
                minReadChars_ = input.readInt32();
                bitField0_ |= 0x00000040;
                break;
              } // case 56
              case 64: {
                readTimeoutMillis_ = input.readInt32();
                bitField0_ |= 0x00000080;
                break;
              } // case 64
              default: {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
            } // switch (tag)
          } // while (!done)
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.unwrapIOException();
        } finally {
          onChanged();
        } // finally
        return this;
      }
      private int bitField0_;

      private java.lang.Object deviceFile_ = "";
      /**
       * string deviceFile = 1;
       * @return The deviceFile.
       */
      public java.lang.String getDeviceFile() {
        java.lang.Object ref = deviceFile_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          deviceFile_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * string deviceFile = 1;
       * @return The bytes for deviceFile.
       */
      public com.google.protobuf.ByteString
          getDeviceFileBytes() {
        java.lang.Object ref = deviceFile_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          deviceFile_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * string deviceFile = 1;
       * @param value The deviceFile to set.
       * @return This builder for chaining.
       */
      public Builder setDeviceFile(
          java.lang.String value) {
        if (value == null) { throw new NullPointerException(); }
        deviceFile_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       * string deviceFile = 1;
       * @return This builder for chaining.
       */
      public Builder clearDeviceFile() {
        deviceFile_ = getDefaultInstance().getDeviceFile();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }
      /**
       * string deviceFile = 1;
       * @param value The bytes for deviceFile to set.
       * @return This builder for chaining.
       */
      public Builder setDeviceFileBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) { throw new NullPointerException(); }
        checkByteStringIsUtf8(value);
        deviceFile_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      private int baud_ ;
      /**
       * int32 baud = 2;
       * @return The baud.
       */
      @java.lang.Override
      public int getBaud() {
        return baud_;
      }
      /**
       * int32 baud = 2;
       * @param value The baud to set.
       * @return This builder for chaining.
       */
      public Builder setBaud(int value) {

        baud_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       * int32 baud = 2;
       * @return This builder for chaining.
       */
      public Builder clearBaud() {
        bitField0_ = (bitField0_ & ~0x00000002);
        baud_ = 0;
        onChanged();
        return this;
      }

      private int dataBits_ ;
      /**
       * int32 dataBits = 3;
       * @return The dataBits.
       */
      @java.lang.Override
      public int getDataBits() {
        return dataBits_;
      }
      /**
       * int32 dataBits = 3;
       * @param value The dataBits to set.
       * @return This builder for chaining.
       */
      public Builder setDataBits(int value) {

        dataBits_ = value;
        bitField0_ |= 0x00000004;
        onChanged();
        return this;
      }
      /**
       * int32 dataBits = 3;
       * @return This builder for chaining.
       */
      public Builder clearDataBits() {
        bitField0_ = (bitField0_ & ~0x00000004);
        dataBits_ = 0;
        onChanged();
        return this;
      }

      private int stopBits_ ;
      /**
       * int32 stopBits = 4;
       * @return The stopBits.
       */
      @java.lang.Override
      public int getStopBits() {
        return stopBits_;
      }
      /**
       * int32 stopBits = 4;
       * @param value The stopBits to set.
       * @return This builder for chaining.
       */
      public Builder setStopBits(int value) {

        stopBits_ = value;
        bitField0_ |= 0x00000008;
        onChanged();
        return this;
      }
      /**
       * int32 stopBits = 4;
       * @return This builder for chaining.
       */
      public Builder clearStopBits() {
        bitField0_ = (bitField0_ & ~0x00000008);
        stopBits_ = 0;
        onChanged();
        return this;
      }

      private int parity_ ;
      /**
       * int32 parity = 5;
       * @return The parity.
       */
      @java.lang.Override
      public int getParity() {
        return parity_;
      }
      /**
       * int32 parity = 5;
       * @param value The parity to set.
       * @return This builder for chaining.
       */
      public Builder setParity(int value) {

        parity_ = value;
        bitField0_ |= 0x00000010;
        onChanged();
        return this;
      }
      /**
       * int32 parity = 5;
       * @return This builder for chaining.
       */
      public Builder clearParity() {
        bitField0_ = (bitField0_ & ~0x00000010);
        parity_ = 0;
        onChanged();
        return this;
      }

      private boolean readBlocking_ ;
      /**
       * bool readBlocking = 6;
       * @return The readBlocking.
       */
      @java.lang.Override
      public boolean getReadBlocking() {
        return readBlocking_;
      }
      /**
       * bool readBlocking = 6;
       * @param value The readBlocking to set.
       * @return This builder for chaining.
       */
      public Builder setReadBlocking(boolean value) {

        readBlocking_ = value;
        bitField0_ |= 0x00000020;
        onChanged();
        return this;
      }
      /**
       * bool readBlocking = 6;
       * @return This builder for chaining.
       */
      public Builder clearReadBlocking() {
        bitField0_ = (bitField0_ & ~0x00000020);
        readBlocking_ = false;
        onChanged();
        return this;
      }

      private int minReadChars_ ;
      /**
       * int32 minReadChars = 7;
       * @return The minReadChars.
       */
      @java.lang.Override
      public int getMinReadChars() {
        return minReadChars_;
      }
      /**
       * int32 minReadChars = 7;
       * @param value The minReadChars to set.
       * @return This builder for chaining.
       */
      public Builder setMinReadChars(int value) {

        minReadChars_ = value;
        bitField0_ |= 0x00000040;
        onChanged();
        return this;
      }
      /**
       * int32 minReadChars = 7;
       * @return This builder for chaining.
       */
      public Builder clearMinReadChars() {
        bitField0_ = (bitField0_ & ~0x00000040);
        minReadChars_ = 0;
        onChanged();
        return this;
      }

      private int readTimeoutMillis_ ;
      /**
       * int32 readTimeoutMillis = 8;
       * @return The readTimeoutMillis.
       */
      @java.lang.Override
      public int getReadTimeoutMillis() {
        return readTimeoutMillis_;
      }
      /**
       * int32 readTimeoutMillis = 8;
       * @param value The readTimeoutMillis to set.
       * @return This builder for chaining.
       */
      public Builder setReadTimeoutMillis(int value) {

        readTimeoutMillis_ = value;
        bitField0_ |= 0x00000080;
        onChanged();
        return this;
      }
      /**
       * int32 readTimeoutMillis = 8;
       * @return This builder for chaining.
       */
      public Builder clearReadTimeoutMillis() {
        bitField0_ = (bitField0_ & ~0x00000080);
        readTimeoutMillis_ = 0;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:diozero.Serial.Open)
    }

    // @@protoc_insertion_point(class_scope:diozero.Serial.Open)
    private static final com.diozero.remote.message.protobuf.Serial.Open DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new com.diozero.remote.message.protobuf.Serial.Open();
    }

    public static com.diozero.remote.message.protobuf.Serial.Open getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser
        PARSER = new com.google.protobuf.AbstractParser() {
      @java.lang.Override
      public Open parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        Builder builder = newBuilder();
        try {
          builder.mergeFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.setUnfinishedMessage(builder.buildPartial());
        } catch (com.google.protobuf.UninitializedMessageException e) {
          throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
        } catch (java.io.IOException e) {
          throw new com.google.protobuf.InvalidProtocolBufferException(e)
              .setUnfinishedMessage(builder.buildPartial());
        }
        return builder.buildPartial();
      }
    };

    public static com.google.protobuf.Parser parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.diozero.remote.message.protobuf.Serial.Open getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface ByteMessageOrBuilder extends
      // @@protoc_insertion_point(interface_extends:diozero.Serial.ByteMessage)
      com.google.protobuf.MessageOrBuilder {

    /**
     * string deviceFile = 1;
     * @return The deviceFile.
     */
    java.lang.String getDeviceFile();
    /**
     * string deviceFile = 1;
     * @return The bytes for deviceFile.
     */
    com.google.protobuf.ByteString
        getDeviceFileBytes();

    /**
     * int32 value = 2;
     * @return The value.
     */
    int getValue();
  }
  /**
   * Protobuf type {@code diozero.Serial.ByteMessage}
   */
  public static final class ByteMessage extends
      com.google.protobuf.GeneratedMessage implements
      // @@protoc_insertion_point(message_implements:diozero.Serial.ByteMessage)
      ByteMessageOrBuilder {
  private static final long serialVersionUID = 0L;
    static {
      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        /* major= */ 4,
        /* minor= */ 28,
        /* patch= */ 2,
        /* suffix= */ "",
        ByteMessage.class.getName());
    }
    // Use ByteMessage.newBuilder() to construct.
    private ByteMessage(com.google.protobuf.GeneratedMessage.Builder builder) {
      super(builder);
    }
    private ByteMessage() {
      deviceFile_ = "";
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_ByteMessage_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_ByteMessage_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.diozero.remote.message.protobuf.Serial.ByteMessage.class, com.diozero.remote.message.protobuf.Serial.ByteMessage.Builder.class);
    }

    public static final int DEVICEFILE_FIELD_NUMBER = 1;
    @SuppressWarnings("serial")
    private volatile java.lang.Object deviceFile_ = "";
    /**
     * string deviceFile = 1;
     * @return The deviceFile.
     */
    @java.lang.Override
    public java.lang.String getDeviceFile() {
      java.lang.Object ref = deviceFile_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        deviceFile_ = s;
        return s;
      }
    }
    /**
     * string deviceFile = 1;
     * @return The bytes for deviceFile.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDeviceFileBytes() {
      java.lang.Object ref = deviceFile_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        deviceFile_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int VALUE_FIELD_NUMBER = 2;
    private int value_ = 0;
    /**
     * int32 value = 2;
     * @return The value.
     */
    @java.lang.Override
    public int getValue() {
      return value_;
    }

    private byte memoizedIsInitialized = -1;
    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceFile_)) {
        com.google.protobuf.GeneratedMessage.writeString(output, 1, deviceFile_);
      }
      if (value_ != 0) {
        output.writeInt32(2, value_);
      }
      getUnknownFields().writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceFile_)) {
        size += com.google.protobuf.GeneratedMessage.computeStringSize(1, deviceFile_);
      }
      if (value_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(2, value_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof com.diozero.remote.message.protobuf.Serial.ByteMessage)) {
        return super.equals(obj);
      }
      com.diozero.remote.message.protobuf.Serial.ByteMessage other = (com.diozero.remote.message.protobuf.Serial.ByteMessage) obj;

      if (!getDeviceFile()
          .equals(other.getDeviceFile())) return false;
      if (getValue()
          != other.getValue()) return false;
      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + DEVICEFILE_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceFile().hashCode();
      hash = (37 * hash) + VALUE_FIELD_NUMBER;
      hash = (53 * hash) + getValue();
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseDelimitedWithIOException(PARSER, input);
    }

    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteMessage parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(com.diozero.remote.message.protobuf.Serial.ByteMessage prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code diozero.Serial.ByteMessage}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder implements
        // @@protoc_insertion_point(builder_implements:diozero.Serial.ByteMessage)
        com.diozero.remote.message.protobuf.Serial.ByteMessageOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_ByteMessage_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_ByteMessage_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.diozero.remote.message.protobuf.Serial.ByteMessage.class, com.diozero.remote.message.protobuf.Serial.ByteMessage.Builder.class);
      }

      // Construct using com.diozero.remote.message.protobuf.Serial.ByteMessage.newBuilder()
      private Builder() {

      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);

      }
      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        deviceFile_ = "";
        value_ = 0;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_ByteMessage_descriptor;
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.ByteMessage getDefaultInstanceForType() {
        return com.diozero.remote.message.protobuf.Serial.ByteMessage.getDefaultInstance();
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.ByteMessage build() {
        com.diozero.remote.message.protobuf.Serial.ByteMessage result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.ByteMessage buildPartial() {
        com.diozero.remote.message.protobuf.Serial.ByteMessage result = new com.diozero.remote.message.protobuf.Serial.ByteMessage(this);
        if (bitField0_ != 0) { buildPartial0(result); }
        onBuilt();
        return result;
      }

      private void buildPartial0(com.diozero.remote.message.protobuf.Serial.ByteMessage result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.deviceFile_ = deviceFile_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.value_ = value_;
        }
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.diozero.remote.message.protobuf.Serial.ByteMessage) {
          return mergeFrom((com.diozero.remote.message.protobuf.Serial.ByteMessage)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.diozero.remote.message.protobuf.Serial.ByteMessage other) {
        if (other == com.diozero.remote.message.protobuf.Serial.ByteMessage.getDefaultInstance()) return this;
        if (!other.getDeviceFile().isEmpty()) {
          deviceFile_ = other.deviceFile_;
          bitField0_ |= 0x00000001;
          onChanged();
        }
        if (other.getValue() != 0) {
          setValue(other.getValue());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 10: {
                deviceFile_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
              case 16: {
                value_ = input.readInt32();
                bitField0_ |= 0x00000002;
                break;
              } // case 16
              default: {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
            } // switch (tag)
          } // while (!done)
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.unwrapIOException();
        } finally {
          onChanged();
        } // finally
        return this;
      }
      private int bitField0_;

      private java.lang.Object deviceFile_ = "";
      /**
       * string deviceFile = 1;
       * @return The deviceFile.
       */
      public java.lang.String getDeviceFile() {
        java.lang.Object ref = deviceFile_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          deviceFile_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * string deviceFile = 1;
       * @return The bytes for deviceFile.
       */
      public com.google.protobuf.ByteString
          getDeviceFileBytes() {
        java.lang.Object ref = deviceFile_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          deviceFile_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * string deviceFile = 1;
       * @param value The deviceFile to set.
       * @return This builder for chaining.
       */
      public Builder setDeviceFile(
          java.lang.String value) {
        if (value == null) { throw new NullPointerException(); }
        deviceFile_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       * string deviceFile = 1;
       * @return This builder for chaining.
       */
      public Builder clearDeviceFile() {
        deviceFile_ = getDefaultInstance().getDeviceFile();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }
      /**
       * string deviceFile = 1;
       * @param value The bytes for deviceFile to set.
       * @return This builder for chaining.
       */
      public Builder setDeviceFileBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) { throw new NullPointerException(); }
        checkByteStringIsUtf8(value);
        deviceFile_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      private int value_ ;
      /**
       * int32 value = 2;
       * @return The value.
       */
      @java.lang.Override
      public int getValue() {
        return value_;
      }
      /**
       * int32 value = 2;
       * @param value The value to set.
       * @return This builder for chaining.
       */
      public Builder setValue(int value) {

        value_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       * int32 value = 2;
       * @return This builder for chaining.
       */
      public Builder clearValue() {
        bitField0_ = (bitField0_ & ~0x00000002);
        value_ = 0;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:diozero.Serial.ByteMessage)
    }

    // @@protoc_insertion_point(class_scope:diozero.Serial.ByteMessage)
    private static final com.diozero.remote.message.protobuf.Serial.ByteMessage DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new com.diozero.remote.message.protobuf.Serial.ByteMessage();
    }

    public static com.diozero.remote.message.protobuf.Serial.ByteMessage getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser
        PARSER = new com.google.protobuf.AbstractParser() {
      @java.lang.Override
      public ByteMessage parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        Builder builder = newBuilder();
        try {
          builder.mergeFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.setUnfinishedMessage(builder.buildPartial());
        } catch (com.google.protobuf.UninitializedMessageException e) {
          throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
        } catch (java.io.IOException e) {
          throw new com.google.protobuf.InvalidProtocolBufferException(e)
              .setUnfinishedMessage(builder.buildPartial());
        }
        return builder.buildPartial();
      }
    };

    public static com.google.protobuf.Parser parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.diozero.remote.message.protobuf.Serial.ByteMessage getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface ByteArrayOrBuilder extends
      // @@protoc_insertion_point(interface_extends:diozero.Serial.ByteArray)
      com.google.protobuf.MessageOrBuilder {

    /**
     * string deviceFile = 1;
     * @return The deviceFile.
     */
    java.lang.String getDeviceFile();
    /**
     * string deviceFile = 1;
     * @return The bytes for deviceFile.
     */
    com.google.protobuf.ByteString
        getDeviceFileBytes();

    /**
     * bytes data = 2;
     * @return The data.
     */
    com.google.protobuf.ByteString getData();
  }
  /**
   * Protobuf type {@code diozero.Serial.ByteArray}
   */
  public static final class ByteArray extends
      com.google.protobuf.GeneratedMessage implements
      // @@protoc_insertion_point(message_implements:diozero.Serial.ByteArray)
      ByteArrayOrBuilder {
  private static final long serialVersionUID = 0L;
    static {
      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        /* major= */ 4,
        /* minor= */ 28,
        /* patch= */ 2,
        /* suffix= */ "",
        ByteArray.class.getName());
    }
    // Use ByteArray.newBuilder() to construct.
    private ByteArray(com.google.protobuf.GeneratedMessage.Builder builder) {
      super(builder);
    }
    private ByteArray() {
      deviceFile_ = "";
      data_ = com.google.protobuf.ByteString.EMPTY;
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_ByteArray_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_ByteArray_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.diozero.remote.message.protobuf.Serial.ByteArray.class, com.diozero.remote.message.protobuf.Serial.ByteArray.Builder.class);
    }

    public static final int DEVICEFILE_FIELD_NUMBER = 1;
    @SuppressWarnings("serial")
    private volatile java.lang.Object deviceFile_ = "";
    /**
     * string deviceFile = 1;
     * @return The deviceFile.
     */
    @java.lang.Override
    public java.lang.String getDeviceFile() {
      java.lang.Object ref = deviceFile_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        deviceFile_ = s;
        return s;
      }
    }
    /**
     * string deviceFile = 1;
     * @return The bytes for deviceFile.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDeviceFileBytes() {
      java.lang.Object ref = deviceFile_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        deviceFile_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int DATA_FIELD_NUMBER = 2;
    private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY;
    /**
     * bytes data = 2;
     * @return The data.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getData() {
      return data_;
    }

    private byte memoizedIsInitialized = -1;
    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceFile_)) {
        com.google.protobuf.GeneratedMessage.writeString(output, 1, deviceFile_);
      }
      if (!data_.isEmpty()) {
        output.writeBytes(2, data_);
      }
      getUnknownFields().writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceFile_)) {
        size += com.google.protobuf.GeneratedMessage.computeStringSize(1, deviceFile_);
      }
      if (!data_.isEmpty()) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, data_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof com.diozero.remote.message.protobuf.Serial.ByteArray)) {
        return super.equals(obj);
      }
      com.diozero.remote.message.protobuf.Serial.ByteArray other = (com.diozero.remote.message.protobuf.Serial.ByteArray) obj;

      if (!getDeviceFile()
          .equals(other.getDeviceFile())) return false;
      if (!getData()
          .equals(other.getData())) return false;
      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + DEVICEFILE_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceFile().hashCode();
      hash = (37 * hash) + DATA_FIELD_NUMBER;
      hash = (53 * hash) + getData().hashCode();
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseDelimitedWithIOException(PARSER, input);
    }

    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input);
    }
    public static com.diozero.remote.message.protobuf.Serial.ByteArray parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(com.diozero.remote.message.protobuf.Serial.ByteArray prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code diozero.Serial.ByteArray}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder implements
        // @@protoc_insertion_point(builder_implements:diozero.Serial.ByteArray)
        com.diozero.remote.message.protobuf.Serial.ByteArrayOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_ByteArray_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_ByteArray_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.diozero.remote.message.protobuf.Serial.ByteArray.class, com.diozero.remote.message.protobuf.Serial.ByteArray.Builder.class);
      }

      // Construct using com.diozero.remote.message.protobuf.Serial.ByteArray.newBuilder()
      private Builder() {

      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);

      }
      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        deviceFile_ = "";
        data_ = com.google.protobuf.ByteString.EMPTY;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_ByteArray_descriptor;
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.ByteArray getDefaultInstanceForType() {
        return com.diozero.remote.message.protobuf.Serial.ByteArray.getDefaultInstance();
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.ByteArray build() {
        com.diozero.remote.message.protobuf.Serial.ByteArray result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.ByteArray buildPartial() {
        com.diozero.remote.message.protobuf.Serial.ByteArray result = new com.diozero.remote.message.protobuf.Serial.ByteArray(this);
        if (bitField0_ != 0) { buildPartial0(result); }
        onBuilt();
        return result;
      }

      private void buildPartial0(com.diozero.remote.message.protobuf.Serial.ByteArray result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.deviceFile_ = deviceFile_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.data_ = data_;
        }
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.diozero.remote.message.protobuf.Serial.ByteArray) {
          return mergeFrom((com.diozero.remote.message.protobuf.Serial.ByteArray)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.diozero.remote.message.protobuf.Serial.ByteArray other) {
        if (other == com.diozero.remote.message.protobuf.Serial.ByteArray.getDefaultInstance()) return this;
        if (!other.getDeviceFile().isEmpty()) {
          deviceFile_ = other.deviceFile_;
          bitField0_ |= 0x00000001;
          onChanged();
        }
        if (other.getData() != com.google.protobuf.ByteString.EMPTY) {
          setData(other.getData());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 10: {
                deviceFile_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
              case 18: {
                data_ = input.readBytes();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
              default: {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
            } // switch (tag)
          } // while (!done)
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.unwrapIOException();
        } finally {
          onChanged();
        } // finally
        return this;
      }
      private int bitField0_;

      private java.lang.Object deviceFile_ = "";
      /**
       * string deviceFile = 1;
       * @return The deviceFile.
       */
      public java.lang.String getDeviceFile() {
        java.lang.Object ref = deviceFile_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          deviceFile_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * string deviceFile = 1;
       * @return The bytes for deviceFile.
       */
      public com.google.protobuf.ByteString
          getDeviceFileBytes() {
        java.lang.Object ref = deviceFile_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          deviceFile_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * string deviceFile = 1;
       * @param value The deviceFile to set.
       * @return This builder for chaining.
       */
      public Builder setDeviceFile(
          java.lang.String value) {
        if (value == null) { throw new NullPointerException(); }
        deviceFile_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       * string deviceFile = 1;
       * @return This builder for chaining.
       */
      public Builder clearDeviceFile() {
        deviceFile_ = getDefaultInstance().getDeviceFile();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }
      /**
       * string deviceFile = 1;
       * @param value The bytes for deviceFile to set.
       * @return This builder for chaining.
       */
      public Builder setDeviceFileBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) { throw new NullPointerException(); }
        checkByteStringIsUtf8(value);
        deviceFile_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY;
      /**
       * bytes data = 2;
       * @return The data.
       */
      @java.lang.Override
      public com.google.protobuf.ByteString getData() {
        return data_;
      }
      /**
       * bytes data = 2;
       * @param value The data to set.
       * @return This builder for chaining.
       */
      public Builder setData(com.google.protobuf.ByteString value) {
        if (value == null) { throw new NullPointerException(); }
        data_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       * bytes data = 2;
       * @return This builder for chaining.
       */
      public Builder clearData() {
        bitField0_ = (bitField0_ & ~0x00000002);
        data_ = getDefaultInstance().getData();
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:diozero.Serial.ByteArray)
    }

    // @@protoc_insertion_point(class_scope:diozero.Serial.ByteArray)
    private static final com.diozero.remote.message.protobuf.Serial.ByteArray DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new com.diozero.remote.message.protobuf.Serial.ByteArray();
    }

    public static com.diozero.remote.message.protobuf.Serial.ByteArray getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser
        PARSER = new com.google.protobuf.AbstractParser() {
      @java.lang.Override
      public ByteArray parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        Builder builder = newBuilder();
        try {
          builder.mergeFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.setUnfinishedMessage(builder.buildPartial());
        } catch (com.google.protobuf.UninitializedMessageException e) {
          throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
        } catch (java.io.IOException e) {
          throw new com.google.protobuf.InvalidProtocolBufferException(e)
              .setUnfinishedMessage(builder.buildPartial());
        }
        return builder.buildPartial();
      }
    };

    public static com.google.protobuf.Parser parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.diozero.remote.message.protobuf.Serial.ByteArray getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface NumBytesOrBuilder extends
      // @@protoc_insertion_point(interface_extends:diozero.Serial.NumBytes)
      com.google.protobuf.MessageOrBuilder {

    /**
     * string deviceFile = 1;
     * @return The deviceFile.
     */
    java.lang.String getDeviceFile();
    /**
     * string deviceFile = 1;
     * @return The bytes for deviceFile.
     */
    com.google.protobuf.ByteString
        getDeviceFileBytes();

    /**
     * int32 length = 2;
     * @return The length.
     */
    int getLength();
  }
  /**
   * Protobuf type {@code diozero.Serial.NumBytes}
   */
  public static final class NumBytes extends
      com.google.protobuf.GeneratedMessage implements
      // @@protoc_insertion_point(message_implements:diozero.Serial.NumBytes)
      NumBytesOrBuilder {
  private static final long serialVersionUID = 0L;
    static {
      com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
        com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
        /* major= */ 4,
        /* minor= */ 28,
        /* patch= */ 2,
        /* suffix= */ "",
        NumBytes.class.getName());
    }
    // Use NumBytes.newBuilder() to construct.
    private NumBytes(com.google.protobuf.GeneratedMessage.Builder builder) {
      super(builder);
    }
    private NumBytes() {
      deviceFile_ = "";
    }

    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_NumBytes_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_NumBytes_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.diozero.remote.message.protobuf.Serial.NumBytes.class, com.diozero.remote.message.protobuf.Serial.NumBytes.Builder.class);
    }

    public static final int DEVICEFILE_FIELD_NUMBER = 1;
    @SuppressWarnings("serial")
    private volatile java.lang.Object deviceFile_ = "";
    /**
     * string deviceFile = 1;
     * @return The deviceFile.
     */
    @java.lang.Override
    public java.lang.String getDeviceFile() {
      java.lang.Object ref = deviceFile_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        deviceFile_ = s;
        return s;
      }
    }
    /**
     * string deviceFile = 1;
     * @return The bytes for deviceFile.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDeviceFileBytes() {
      java.lang.Object ref = deviceFile_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        deviceFile_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int LENGTH_FIELD_NUMBER = 2;
    private int length_ = 0;
    /**
     * int32 length = 2;
     * @return The length.
     */
    @java.lang.Override
    public int getLength() {
      return length_;
    }

    private byte memoizedIsInitialized = -1;
    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceFile_)) {
        com.google.protobuf.GeneratedMessage.writeString(output, 1, deviceFile_);
      }
      if (length_ != 0) {
        output.writeInt32(2, length_);
      }
      getUnknownFields().writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!com.google.protobuf.GeneratedMessage.isStringEmpty(deviceFile_)) {
        size += com.google.protobuf.GeneratedMessage.computeStringSize(1, deviceFile_);
      }
      if (length_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(2, length_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof com.diozero.remote.message.protobuf.Serial.NumBytes)) {
        return super.equals(obj);
      }
      com.diozero.remote.message.protobuf.Serial.NumBytes other = (com.diozero.remote.message.protobuf.Serial.NumBytes) obj;

      if (!getDeviceFile()
          .equals(other.getDeviceFile())) return false;
      if (getLength()
          != other.getLength()) return false;
      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + DEVICEFILE_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceFile().hashCode();
      hash = (37 * hash) + LENGTH_FIELD_NUMBER;
      hash = (53 * hash) + getLength();
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseFrom(
        java.nio.ByteBuffer data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input);
    }
    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseDelimitedWithIOException(PARSER, input);
    }

    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input);
    }
    public static com.diozero.remote.message.protobuf.Serial.NumBytes parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessage
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(com.diozero.remote.message.protobuf.Serial.NumBytes prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code diozero.Serial.NumBytes}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder implements
        // @@protoc_insertion_point(builder_implements:diozero.Serial.NumBytes)
        com.diozero.remote.message.protobuf.Serial.NumBytesOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_NumBytes_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_NumBytes_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.diozero.remote.message.protobuf.Serial.NumBytes.class, com.diozero.remote.message.protobuf.Serial.NumBytes.Builder.class);
      }

      // Construct using com.diozero.remote.message.protobuf.Serial.NumBytes.newBuilder()
      private Builder() {

      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);

      }
      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        deviceFile_ = "";
        length_ = 0;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_NumBytes_descriptor;
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.NumBytes getDefaultInstanceForType() {
        return com.diozero.remote.message.protobuf.Serial.NumBytes.getDefaultInstance();
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.NumBytes build() {
        com.diozero.remote.message.protobuf.Serial.NumBytes result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.diozero.remote.message.protobuf.Serial.NumBytes buildPartial() {
        com.diozero.remote.message.protobuf.Serial.NumBytes result = new com.diozero.remote.message.protobuf.Serial.NumBytes(this);
        if (bitField0_ != 0) { buildPartial0(result); }
        onBuilt();
        return result;
      }

      private void buildPartial0(com.diozero.remote.message.protobuf.Serial.NumBytes result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.deviceFile_ = deviceFile_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.length_ = length_;
        }
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof com.diozero.remote.message.protobuf.Serial.NumBytes) {
          return mergeFrom((com.diozero.remote.message.protobuf.Serial.NumBytes)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.diozero.remote.message.protobuf.Serial.NumBytes other) {
        if (other == com.diozero.remote.message.protobuf.Serial.NumBytes.getDefaultInstance()) return this;
        if (!other.getDeviceFile().isEmpty()) {
          deviceFile_ = other.deviceFile_;
          bitField0_ |= 0x00000001;
          onChanged();
        }
        if (other.getLength() != 0) {
          setLength(other.getLength());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 10: {
                deviceFile_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
              case 16: {
                length_ = input.readInt32();
                bitField0_ |= 0x00000002;
                break;
              } // case 16
              default: {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
            } // switch (tag)
          } // while (!done)
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.unwrapIOException();
        } finally {
          onChanged();
        } // finally
        return this;
      }
      private int bitField0_;

      private java.lang.Object deviceFile_ = "";
      /**
       * string deviceFile = 1;
       * @return The deviceFile.
       */
      public java.lang.String getDeviceFile() {
        java.lang.Object ref = deviceFile_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          deviceFile_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * string deviceFile = 1;
       * @return The bytes for deviceFile.
       */
      public com.google.protobuf.ByteString
          getDeviceFileBytes() {
        java.lang.Object ref = deviceFile_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          deviceFile_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * string deviceFile = 1;
       * @param value The deviceFile to set.
       * @return This builder for chaining.
       */
      public Builder setDeviceFile(
          java.lang.String value) {
        if (value == null) { throw new NullPointerException(); }
        deviceFile_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       * string deviceFile = 1;
       * @return This builder for chaining.
       */
      public Builder clearDeviceFile() {
        deviceFile_ = getDefaultInstance().getDeviceFile();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }
      /**
       * string deviceFile = 1;
       * @param value The bytes for deviceFile to set.
       * @return This builder for chaining.
       */
      public Builder setDeviceFileBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) { throw new NullPointerException(); }
        checkByteStringIsUtf8(value);
        deviceFile_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      private int length_ ;
      /**
       * int32 length = 2;
       * @return The length.
       */
      @java.lang.Override
      public int getLength() {
        return length_;
      }
      /**
       * int32 length = 2;
       * @param value The length to set.
       * @return This builder for chaining.
       */
      public Builder setLength(int value) {

        length_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       * int32 length = 2;
       * @return This builder for chaining.
       */
      public Builder clearLength() {
        bitField0_ = (bitField0_ & ~0x00000002);
        length_ = 0;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:diozero.Serial.NumBytes)
    }

    // @@protoc_insertion_point(class_scope:diozero.Serial.NumBytes)
    private static final com.diozero.remote.message.protobuf.Serial.NumBytes DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new com.diozero.remote.message.protobuf.Serial.NumBytes();
    }

    public static com.diozero.remote.message.protobuf.Serial.NumBytes getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser
        PARSER = new com.google.protobuf.AbstractParser() {
      @java.lang.Override
      public NumBytes parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        Builder builder = newBuilder();
        try {
          builder.mergeFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.setUnfinishedMessage(builder.buildPartial());
        } catch (com.google.protobuf.UninitializedMessageException e) {
          throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
        } catch (java.io.IOException e) {
          throw new com.google.protobuf.InvalidProtocolBufferException(e)
              .setUnfinishedMessage(builder.buildPartial());
        }
        return builder.buildPartial();
      }
    };

    public static com.google.protobuf.Parser parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.diozero.remote.message.protobuf.Serial.NumBytes getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.diozero.remote.message.protobuf.Serial)) {
      return super.equals(obj);
    }
    com.diozero.remote.message.protobuf.Serial other = (com.diozero.remote.message.protobuf.Serial) obj;

    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.diozero.remote.message.protobuf.Serial parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.diozero.remote.message.protobuf.Serial parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.diozero.remote.message.protobuf.Serial parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.diozero.remote.message.protobuf.Serial parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.diozero.remote.message.protobuf.Serial parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.diozero.remote.message.protobuf.Serial parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.diozero.remote.message.protobuf.Serial parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input);
  }
  public static com.diozero.remote.message.protobuf.Serial parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public static com.diozero.remote.message.protobuf.Serial parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseDelimitedWithIOException(PARSER, input);
  }

  public static com.diozero.remote.message.protobuf.Serial parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.diozero.remote.message.protobuf.Serial parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input);
  }
  public static com.diozero.remote.message.protobuf.Serial parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.diozero.remote.message.protobuf.Serial prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessage.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * Protobuf type {@code diozero.Serial}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessage.Builder implements
      // @@protoc_insertion_point(builder_implements:diozero.Serial)
      com.diozero.remote.message.protobuf.SerialOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.diozero.remote.message.protobuf.Serial.class, com.diozero.remote.message.protobuf.Serial.Builder.class);
    }

    // Construct using com.diozero.remote.message.protobuf.Serial.newBuilder()
    private Builder() {

    }

    private Builder(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      super(parent);

    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.diozero.remote.message.protobuf.Diozero.internal_static_diozero_Serial_descriptor;
    }

    @java.lang.Override
    public com.diozero.remote.message.protobuf.Serial getDefaultInstanceForType() {
      return com.diozero.remote.message.protobuf.Serial.getDefaultInstance();
    }

    @java.lang.Override
    public com.diozero.remote.message.protobuf.Serial build() {
      com.diozero.remote.message.protobuf.Serial result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.diozero.remote.message.protobuf.Serial buildPartial() {
      com.diozero.remote.message.protobuf.Serial result = new com.diozero.remote.message.protobuf.Serial(this);
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.diozero.remote.message.protobuf.Serial) {
        return mergeFrom((com.diozero.remote.message.protobuf.Serial)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.diozero.remote.message.protobuf.Serial other) {
      if (other == com.diozero.remote.message.protobuf.Serial.getDefaultInstance()) return this;
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                done = true; // was an endgroup tag
              }
              break;
            } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    // @@protoc_insertion_point(builder_scope:diozero.Serial)
  }

  // @@protoc_insertion_point(class_scope:diozero.Serial)
  private static final com.diozero.remote.message.protobuf.Serial DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.diozero.remote.message.protobuf.Serial();
  }

  public static com.diozero.remote.message.protobuf.Serial getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser
      PARSER = new com.google.protobuf.AbstractParser() {
    @java.lang.Override
    public Serial parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      Builder builder = newBuilder();
      try {
        builder.mergeFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(builder.buildPartial());
      } catch (com.google.protobuf.UninitializedMessageException e) {
        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(e)
            .setUnfinishedMessage(builder.buildPartial());
      }
      return builder.buildPartial();
    }
  };

  public static com.google.protobuf.Parser parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.diozero.remote.message.protobuf.Serial getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy