String
by decoding the specified array of bytes using the UTF-8 charset.
14 | *
15 | * @param bytes
16 | * The bytes to be decoded into characters
17 | * @return A new String
decoded from the specified array of bytes using the UTF-8 charset,
18 | * or {@code null} if the input byte array was {@code null}.
19 | * @throws NullPointerException
20 | * Thrown if {@link Charsets#UTF_8} is not initialized, which should never happen since it is
21 | * required by the Java platform specification.
22 | * @since As of 1.7, throws {@link NullPointerException} instead of UnsupportedEncodingException
23 | */
24 | public static String newStringUtf8(final byte[] bytes) {
25 | return bytes == null ? null : new String(bytes, Charset.forName("UTF-8"));
26 | }
27 |
28 | /**
29 | * Encodes the given string into a sequence of bytes using the UTF-8 charset, storing the result into a new byte
30 | * array.
31 | *
32 | * @param string
33 | * the String to encode, may be {@code null}
34 | * @return encoded bytes, or {@code null} if the input string was {@code null}
35 | * @throws NullPointerException
36 | * Thrown if {@link Charsets#UTF_8} is not initialized, which should never happen since it is
37 | * required by the Java platform specification.
38 | * @since As of 1.7, throws {@link NullPointerException} instead of UnsupportedEncodingException
39 | * @see Standard charsets
40 | * @see #getBytesUnchecked(String, String)
41 | */
42 | public static byte[] getBytesUtf8(final String string) {
43 | if (string == null) {
44 | return null;
45 | }
46 | return string.getBytes(Charset.forName("UTF-8"));
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/common/src/main/java/com/rekoe/common/image/type/ImageType.java:
--------------------------------------------------------------------------------
1 | package com.rekoe.common.image.type;
2 |
3 | /**
4 | * 图片类型
5 | * @author mdc
6 | * @date 2015年2月27日
7 | */
8 | public enum ImageType {
9 |
10 | /**
11 | * png图片
12 | */
13 | PNG("image/png", "png", "data:image/png;base64,"),
14 | /**
15 | * jpg图片
16 | */
17 | JPG("image/jpg", "jpg", "data:image/jpeg;base64,"),
18 | /**
19 | * jpg图片
20 | */
21 | JPEG("image/jpeg", "jpeg", "data:image/jpeg;base64,"),
22 | /**
23 | * bmp图片
24 | */
25 | BMP("image/bmp", "bmp", "data:image/bmp;base64,"),
26 | /**
27 | * wbmp图片
28 | */
29 | WBMP("image/vnd.wap.wbmp", "wbmp", "data:image/wbmp;base64,"),
30 | /**
31 | * gif图片
32 | */
33 | GIF("image/gif", "gif", "data:image/gif;base64,");
34 |
35 | private String type;
36 | private String media;
37 | private String b64Prefix; //base64编码前缀
38 |
39 | ImageType(String media, String type, String b64Prefix){
40 | this.media = media;
41 | this.type = type;
42 | this.b64Prefix = b64Prefix;
43 | }
44 |
45 | @Override
46 | public String toString() {
47 | return this.type;
48 | }
49 |
50 | /**
51 | * 获取图片类型
52 | * @author mdc
53 | * @date 2015年2月27日
54 | * @return
55 | */
56 | public String getType(){
57 | return this.type;
58 | }
59 |
60 | /**
61 | * 获取图片的Media
62 | * @author mdc
63 | * @date 2015年6月10日
64 | * @return
65 | */
66 | public String getMedia(){
67 | return this.media;
68 | }
69 |
70 | /**
71 | * @return 获取{@link #b64Prefix}
72 | */
73 | public String getB64Prefix() {
74 | return b64Prefix;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/common/src/main/java/com/rekoe/common/large/excell/to/bean/ta/checkedRun/MainApp.java:
--------------------------------------------------------------------------------
1 | package com.rekoe.common.large.excell.to.bean.ta.checkedRun;
2 |
3 | import java.nio.file.Files;
4 | import java.nio.file.Paths;
5 | import java.util.List;
6 |
7 | import org.nutz.log.Log;
8 | import org.nutz.log.Logs;
9 |
10 | import com.rekoe.common.large.excell.to.bean.ta.bean.ExampleBean;
11 | import com.rekoe.common.large.excell.to.bean.ta.utilities.enums.ExcelFactoryType;
12 | import com.rekoe.common.large.excell.to.bean.ta.utilities.factory.Parser;
13 | /**
14 | *
15 | * @author Taleh Algayev
16 | * Jun 1, 2018
17 | */
18 | public class MainApp {
19 | final static Log log = Logs.get();
20 | public static void main(String[] args) throws Exception {
21 |
22 | Parser