code: public static byte[] appendByte(byte[] bytes, byte b) {
          byte[] result = Arrays.copyOf(bytes, bytes.length + 1);
          result[result.length - 1] = b;
          return result;
      }
docs: Creates a copy of bytes and appends b to the end of it
  
  @param bytes
  bytes data
  @param b
  append byte
  @return appended byte[]