The list of methods to do Encode are organized into topic(s).
byte[]
encode(Object o) encode
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream os = new ObjectOutputStream(bos);
os.writeObject(o);
os.close();
bos.close();
byte[] arr = bos.toByteArray();
return arr;
String
encode(Object obj) json encode
try {
return new ObjectMapper().disable(SerializationFeature.FAIL_ON_EMPTY_BEANS).writeValueAsString(obj);
} catch (IOException e) {
throw new IllegalStateException(e);
String
encode(Serializable s) encode
try (ByteArrayOutputStream of = new ByteArrayOutputStream();
ObjectOutputStream so = new ObjectOutputStream(of)) {
so.writeObject(s);
so.flush();
return Base64.getEncoder().encodeToString(of.toByteArray());
} catch (IOException e) {
throw new UnsupportedOperationException(e);
byte[]
encode(T obj) encode
byte[] bytes = null;
try {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(bout);
out.writeObject(obj);
bytes = bout.toByteArray();
} catch (IOException e) {
e.printStackTrace();
...
byte[]
encode_u8(String what) encodu
byte u8[];
if (what == null) {
u8 = null;
} else {
try {
u8 = what.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
...
InternetAddress[]
encodeAddresses(String string, String charset) Encode UTF strings into mail addresses.
if (string == null) {
return null;
InternetAddress[] xaddresses = InternetAddress.parse(string);
if (charset != null) {
for (int xindex = 0; xindex < xaddresses.length; xindex++) {
String xpersonal = xaddresses[xindex].getPersonal();
try {
...