@InterfaceAudience.Public @InterfaceStability.Stable public enum XAttrCodec extends Enum<XAttrCodec>
XAttr
is byte[], this class is to
covert byte[] to some kind of string representation or convert back.
String representation is convenient for display and input. For example
display in screen as shell response and json response, input as http
or shell parameter.列挙型定数と説明 |
---|
BASE64
Value encoded as base64 string
is prefixed with 0s.
|
HEX
Value encoded as hexadecimal string
is prefixed with 0x.
|
TEXT
Value encoded as text
string is enclosed in double quotes (\").
|
修飾子とタイプ | メソッドと説明 |
---|---|
static byte[] |
decodeValue(String value)
Decode string representation of a value and check whether it's
encoded.
|
static String |
encodeValue(byte[] value,
XAttrCodec encoding)
Encode byte[] value to string representation with encoding.
|
static XAttrCodec |
valueOf(String name)
指定した名前を持つこの型の列挙型定数を返します。
|
static XAttrCodec[] |
values()
この列挙型の定数を含む配列を宣言されている順序で返します。
|
public static final XAttrCodec TEXT
public static final XAttrCodec HEX
public static final XAttrCodec BASE64
public static XAttrCodec[] values()
for(XAttrCodec c: XAttrCodec.values()) System.out.println(c);
public static XAttrCodec valueOf(String name)
name
- 返される列挙型定数の名前。IllegalArgumentException
- この列挙型に、指定した名前の定数がない場合NullPointerException
- 引数がnullの場合public static byte[] decodeValue(String value) throws IOException
value
- string representation of the value.IOException
public static String encodeValue(byte[] value, XAttrCodec encoding) throws IOException
value
- byte[] valueencoding
- IOException
Copyright © 2016 Apache Software Foundation. All rights reserved.