@Override
  public byte[] toByteArray() {
    FilterProtos.PrefixFilter.Builder builder = FilterProtos.PrefixFilter.newBuilder();
    if (this.prefix != null) {
      builder.setPrefix(UnsafeByteOperations.unsafeWrap(this.prefix));
    }
    return builder.build().toByteArray();
  }
Returns The filter serialized using pb
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/PrefixFilter.java