public class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BASE64_DECODE_ERROR |
static String |
BASE64_ENCODE_ERROR |
static String |
PACKAGE_TIME |
static String |
PROTOCOL_PACKAGE_MIME |
static String |
PROTOCOL_PACKAGE_UTIL |
static int |
READABLE_BUFFER_SIZE |
static String |
STRUCT_TYPE_TIME |
static String |
STRUCT_TYPE_TIMEZONE |
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static BStruct |
createConversionError(Context context,
String msg) |
static BStruct |
createTimeStruct(StructInfo timezoneStructInfo,
StructInfo timeStructInfo,
long millis,
String zoneIdName) |
static BStruct |
createTimeZone(StructInfo timezoneStructInfo,
String zoneIdValue) |
static void |
decode(Context context,
BValue encodedInput,
String charset,
boolean isMimeSpecific)
Decode a given BValue using Base64 encoding scheme.
|
static void |
decodeBlob(Context context,
byte[] encodedContent,
boolean isMimeSpecific)
Decode a given blob using Base64 encoding scheme.
|
static void |
decodeByteChannel(Context context,
BStruct byteChannel,
boolean isMimeSpecific)
Decode a given byte channel using Base64 encoding scheme.
|
static void |
decodeString(Context context,
String stringToBeDecoded,
String charset,
boolean isMimeSpecific)
Decode a given encoded string using Base64 encoding scheme.
|
static void |
encode(Context context,
BValue input,
String charset,
boolean isMimeSpecific)
Encode a given BValue using Base64 encoding scheme.
|
static void |
encodeBlob(Context context,
byte[] bytes,
boolean isMimeSpecific)
Encode a given blob using Base64 encoding scheme.
|
static void |
encodeByteChannel(Context context,
BStruct byteChannel,
boolean isMimeSpecific)
Encode a given byte channel using Base64 encoding scheme.
|
static void |
encodeString(Context context,
String stringToBeEncoded,
String charset,
boolean isMimeSpecific)
Encode a given string using Base64 encoding scheme.
|
static StructInfo |
getTimeStructInfo(Context context) |
static StructInfo |
getTimeZoneStructInfo(Context context) |
public static final String PACKAGE_TIME
public static final String STRUCT_TYPE_TIME
public static final String STRUCT_TYPE_TIMEZONE
public static final int READABLE_BUFFER_SIZE
public static final String PROTOCOL_PACKAGE_UTIL
public static final String PROTOCOL_PACKAGE_MIME
public static final String BASE64_ENCODE_ERROR
public static final String BASE64_DECODE_ERROR
public static BStruct createTimeZone(StructInfo timezoneStructInfo, String zoneIdValue)
public static BStruct createTimeStruct(StructInfo timezoneStructInfo, StructInfo timeStructInfo, long millis, String zoneIdName)
public static StructInfo getTimeZoneStructInfo(Context context)
public static StructInfo getTimeStructInfo(Context context)
public static void encode(Context context, BValue input, String charset, boolean isMimeSpecific)
context
- Represent a ballerina contextinput
- Represent a BValue which can be of type blob, string or byte channelcharset
- Represent the charset value to be used with stringisMimeSpecific
- A boolean indicating whether the encoder should be mime specific or notpublic static void decode(Context context, BValue encodedInput, String charset, boolean isMimeSpecific)
context
- Represent a ballerina contextencodedInput
- Represent an encoded BValue which can be of type blob, string or byte channelcharset
- Represent the charset value to be used with stringisMimeSpecific
- A boolean indicating whether the decoder should be mime specific or notpublic static void encodeString(Context context, String stringToBeEncoded, String charset, boolean isMimeSpecific)
context
- Represent a ballerina contextstringToBeEncoded
- Represent the string that needs to be encodedcharset
- Represent the charset value to be used with stringisMimeSpecific
- A boolean indicating whether the encoder should be mime specific or notpublic static void decodeString(Context context, String stringToBeDecoded, String charset, boolean isMimeSpecific)
context
- Represent a ballerina contextstringToBeDecoded
- Represent the string that needs to be decodedcharset
- Represent the charset value to be used with stringisMimeSpecific
- A boolean indicating whether the decoder should be mime specific or notpublic static void encodeByteChannel(Context context, BStruct byteChannel, boolean isMimeSpecific)
context
- Represent a ballerina contextbyteChannel
- Represent the byte channel that needs to be encodedisMimeSpecific
- A boolean indicating whether the encoder should be mime specific or notpublic static void decodeByteChannel(Context context, BStruct byteChannel, boolean isMimeSpecific)
context
- Represent a ballerina contextbyteChannel
- Represent the byte channel that needs to be decodedisMimeSpecific
- A boolean indicating whether the encoder should be mime specific or notpublic static void encodeBlob(Context context, byte[] bytes, boolean isMimeSpecific)
context
- Represent a ballerina contextbytes
- Represent the blob that needs to be encodedisMimeSpecific
- A boolean indicating whether the encoder should be mime specific or notpublic static void decodeBlob(Context context, byte[] encodedContent, boolean isMimeSpecific)
context
- Represent a ballerina contextencodedContent
- Represent the blob that needs to be decodedisMimeSpecific
- A boolean indicating whether the encoder should be mime specific or notCopyright © 2018 WSO2. All rights reserved.