code: private void setValueFromObject(byte[] bytes) {
          if (type.equals(QualifiedName_XSD_BASE64_BINARY)) {
              setValue(ProvFactory.getFactory().base64Encoding(bytes));
          } else if (type.equals(QualifiedName_XSD_HEX_BINARY)) {
              setValue(ProvFactory.getFactory().hexEncoding(bytes));
          }
      }
docs: Converts a byte array in base64 or hexadecimal according to specified type.
  
  @param bytes array of bytes to convert