Returns encoded bytes.

@param name
field name.
@return encoded byte array.
498913
byte[] getEncodedBytes(final String name)
    {
        try
        {
            if (name != null)
            {
                return name.getBytes(Constants.CHARSET_UTF8);
            }
        }
        catch (UnsupportedEncodingException e)
        {
            logger.error("Error during persist, Caused by:", e);
            throw new PersistenceException(e);
        }

        return null;
    }
207500
public static String serializeEncodedRequest(String username) {
    MiniMessagePack.Packer packer = new MiniMessagePack.Packer();
    packer.pack(1);
    packer.pack('q');
    packer.pack(username);
    return ASCIICodec.encode(packer.getBytes());
  }
70712
public static String getString(byte[] bytes, String encoding) {
        try {
            return new String(bytes, encoding);
        } catch(UnsupportedEncodingException e) {
            throw new IllegalArgumentException(encoding + " is not a known encoding name.", e);
        }
    }
1299503
public String getHeader(String name) {
		if(name == null) {
			throw new NullPointerException("header name is null");
		}
		try {
			return RFC2396UrlDecoder.decode(((javax.sip.address.SipURI) super.uri).getHeader(name));
		} catch (NullPointerException e) {
			return null;
		}
	}
334593
public function getEncodedHeader(string $name): ?string
    {
        $offset = \strlen($name) + 2; // colon + space

        if (!isset($this->headers[$name])) {
            return null;
        }

        if (\is_array($this->headers[$name])) {
            $s = '';
            foreach ($this->headers[$name] as $email => $mailer) {
                if ($mailer != null) { // intentionally ==
                    $s .= self::encodeHeader($mailer, $offset, true);
                    $email = " <$email>";
                }
                $s .= self::append($email . ',', $offset);
            }

            return \ltrim(\substr($s, 0, -1)); // last comma
        }

        if (\preg_match('#^(\S+; (?:file)?name=)"(.*)"\z#', $this->headers[$name], $m)) { // Content-Disposition
            $offset += \strlen($m[1]);

            return $m[1] . '"' . self::encodeHeader($m[2], $offset) . '"';

        }

        return \ltrim(self::encodeHeader($this->headers[$name], $offset));
    }
294952
public Field getField(String name) {
    FieldInfo fieldInfo = getFieldInfo(name);
    return fieldInfo == null ? null : fieldInfo.getField();
  }
213090
public ObjectStreamField getField(String name) {
        ObjectStreamField[] allFields = getFields();
        for (int i = 0; i < allFields.length; i++) {
            ObjectStreamField f = allFields[i];
            if (f.getName().equals(name)) {
                return f;
            }
        }
        return null;
    }
368820
private static FieldInfo getFieldInfo(char[] name,int offset,int length)
    {
        Map.Entry entry = __info.getEntry(name,offset,length);
        if (entry==null)
            return new FieldInfo(new String(name,offset,length),false);

        return (FieldInfo) entry.getValue();
    }
1230460
public long getDateHeader(String name)
    {
        HeaderField f = getHeaderField(name);
        if (f != null)
        {
            return f.getDateValue();
        }
        else
        {
            return -1;
        }
    }
184615
public JsonArray getJsonArray(String name) throws JsonException {
        JsonElement el = get(name);
        if (!el.isJsonArray()) {
            throw Util.typeMismatch(name, el, "JsonArray");
        }
        return el.asJsonArray();
    }
1335044
@Override
    @SuppressWarnings("StringEquality")
    public Object getField(String name) throws UnresolvedException{
        if(name=="method")
            return method==null ? null : method.toString();
        else if(name=="uri")
            return uri;
        else if(name=="line")
            return method+" "+uri+' '+version;
        else if(name=="query_string"){
            if(uri==null)
                return null;
            int question = uri.indexOf('?');
            return question==-1 ? "" : uri.substring(question+1);
        }else if(name=="cookies")
            return getCookies();
        else
            return super.getField(name);
    }
141189
@Override
    public Object getMember(String name) {
        switch (name) {
            case "format":
                return F_format;
            case "schema":
                return F_schema;
            case "option":
                return F_option;
            case "load":
                return F_load;
            case "json":
                return F_json;
            case "csv":
                return F_csv;
            case "parquet":
                return F_parquet;
            case "text":
                return F_text;
        }
        return super.getMember(name);
    }
1074541
public static String encode(byte[] bytes) {
		int bytesLength = bytes.length;
		int base64Length = (bytesLength * 4 + 2) / 3; // base64 encoded string length, without padding

		StringBuilder base64Builder = new StringBuilder();
		int bytesIndex = 0;

		while (bytesIndex < bytesLength) {
			int i0 = bytes[bytesIndex++] & 0xff;
			int i1 = bytesIndex < bytesLength ? bytes[bytesIndex++] & 0xff : 0;
			int i2 = bytesIndex < bytesLength ? bytes[bytesIndex++] & 0xff : 0;

			int o0 = i0 >>> 2;
			int o1 = ((i0 & 3) << 4) | (i1 >>> 4);
			int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6);
			int o3 = i2 & 0x3F;

			base64Builder.append(NIBLES_2_CHARS[o0]);
			base64Builder.append(NIBLES_2_CHARS[o1]);
			base64Builder.append(base64Builder.length() < base64Length ? NIBLES_2_CHARS[o2] : '=');
			base64Builder.append(base64Builder.length() < base64Length ? NIBLES_2_CHARS[o3] : '=');
		}

		return base64Builder.toString();
	}
620198
@Override
    @SuppressWarnings("StringEquality")
    public Object getField(String name) throws UnresolvedException{
        if(name=="protocol")
            return getSession().getProtocol();
        else if(name=="cipher")
            return getSession().getCipherSuite();
        else if(name=="local")
            return new CertificateBean((X509Certificate)getSession().getLocalCertificates()[0]);
        else if(name=="peer"){
            try{
                return new CertificateBean((X509Certificate)getSession().getPeerCertificates()[0]);
            }catch(SSLPeerUnverifiedException ex){
                return null;
            }
        }else
            throw new UnresolvedException(name);
    }
355000
public static String encode(byte[] bytes) {
    if (null == bytes) {
      return null;
    }
    ByteArrayOutputStream out = new ByteArrayOutputStream((int) (bytes.length * 1.37));
    Base64Encoder encodedOut = new Base64Encoder(out);

    try {
      encodedOut.write(bytes);
      encodedOut.close();

      return out.toString("UTF-8");
    } catch (IOException ignored) {
      return null;
    }
  }
427862
public byte[] getEncodedInternal() throws IOException {
        if (encoded == null) {
            DerOutputStream     out = new DerOutputStream();
            DerOutputStream     tmp = new DerOutputStream();
            for (int i = 0; i < names.length; i++) {
                names[i].encode(tmp);
            }
            out.write(DerValue.tag_Sequence, tmp);
            encoded = out.toByteArray();
        }
        return encoded;
    }
1342007
public JavaField getField(String name)
  {
    ArrayList<JavaField> fieldList = getFieldList();
    
    for (int i = 0; i < fieldList.size(); i++) {
      JavaField field = fieldList.get(i);

      if (field.getName().equals(name))
        return field;
    }

    return null;
  }