@@ -52,8 +52,8 @@ public static byte[] imageToBytes(BufferedImage img) {
5252 }
5353 }
5454
55- public static String combineTextBlocks (List <TextBlock > textBlocks ) {
56- Collections .sort (textBlocks , Comparator .comparingInt (o -> o .getTopLeft ().y ));
55+ static String combineTextBlocks (List <TextBlock > textBlocks ) {
56+ textBlocks .sort (Comparator .comparingInt (o -> o .getTopLeft ().y ));
5757 List <List <TextBlock >> lineBlocks = new ArrayList <>();
5858 int lastY = -1 ;
5959 List <TextBlock > lineBlock = new ArrayList <>();
@@ -69,7 +69,7 @@ public static String combineTextBlocks(List<TextBlock> textBlocks) {
6969 sameLine = textBlock .getTopLeft ().y - lastY <= SAME_LINE_LIMIT ;
7070 }
7171 if (!sameLine ) {
72- Collections .sort (lineBlock , Comparator .comparingInt (o -> o .getTopLeft ().x ));
72+ lineBlock .sort (Comparator .comparingInt (o -> o .getTopLeft ().x ));
7373 lineBlocks .add (lineBlock );
7474 lineBlock = new ArrayList <>();
7575 sameLine = true ;
@@ -78,7 +78,7 @@ public static String combineTextBlocks(List<TextBlock> textBlocks) {
7878 lineBlock .add (textBlock );
7979 }
8080 if (lineBlock .size () > 0 ) {
81- Collections .sort (lineBlock , Comparator .comparingInt (o -> o .getTopLeft ().x ));
81+ lineBlock .sort (Comparator .comparingInt (o -> o .getTopLeft ().x ));
8282 lineBlocks .add (lineBlock );
8383 }
8484 StringBuilder sb = new StringBuilder ();
@@ -99,16 +99,16 @@ public static String combineTextBlocks(List<TextBlock> textBlocks) {
9999 return sb .toString ();
100100 }
101101
102- public static Point frameToPoint (String text ) {
102+ static Point frameToPoint (String text ) {
103103 String [] arr = text .split ("," );
104104 return new Point (Integer .valueOf (arr [0 ].trim ()), Integer .valueOf (arr [1 ].trim ()));
105105 }
106106
107- public static String postMultiData (String url , byte [] data , String boundary ) {
107+ static String postMultiData (String url , byte [] data , String boundary ) {
108108 return postMultiData (url , data , boundary , "" , "" );
109109 }
110110
111- public static String postMultiData (String url , byte [] data , String boundary , String cookie , String referer ) {
111+ private static String postMultiData (String url , byte [] data , String boundary , String cookie , String referer ) {
112112 try {
113113 HttpRequest request = HttpUtil .createPost (url ).timeout (15000 );
114114 request .contentType ("multipart/form-data; boundary=" + boundary );
@@ -127,7 +127,7 @@ public static String postMultiData(String url, byte[] data, String boundary, Str
127127 }
128128 }
129129
130- public static byte [] mergeByte (byte []... bytes ) {
130+ static byte [] mergeByte (byte []... bytes ) {
131131 int length = 0 ;
132132 for (byte [] b : bytes ) {
133133 length += b .length ;
0 commit comments