소스정리

main
이범준 1 year ago
parent c41039b876
commit 2710f9f8e6

@ -70,6 +70,10 @@ abstract public class LayoutParser {
this.descriptor = descriptor; this.descriptor = descriptor;
} }
/** .<br />
* @param dataObject , File
* @return
*/
public void setFileDefaultInfo(DataObject dataObject, File file) { public void setFileDefaultInfo(DataObject dataObject, File file) {
String filePath = file.getPath(); String filePath = file.getPath();
dataObject.put("FILE_PATH", filePath); dataObject.put("FILE_PATH", filePath);
@ -195,6 +199,10 @@ abstract public class LayoutParser {
} }
} }
/** .<br />
* @param string , sep
* @return
*/
public String[] smartSplit(String string, JSONArray jsonArray) { public String[] smartSplit(String string, JSONArray jsonArray) {
List<Integer> byteNums = new ArrayList(); List<Integer> byteNums = new ArrayList();

@ -99,15 +99,20 @@ public class SingleFileParser extends LayoutParser {
String jpgName = ""; String jpgName = "";
boolean jpgIn = false; boolean jpgIn = false;
int jpgNum = 0; int jpgNum = 0;
String jpgNamePiece = "";
for (int i = 0; i < imgContent.length(); i++) { for (int i = 0; i < imgContent.length(); i++) {
boolean jpgStart = (i != imgContent.length()-1) && (imgContent.charAt(i) == 0xFF && imgContent.charAt(i+1) == 0xD8); boolean jpgStart = (i != imgContent.length()-1) && (imgContent.charAt(i) == 0xFF && imgContent.charAt(i+1) == 0xD8);
boolean jpgEnd = (i != 0) && (imgContent.charAt(i-1) == 0xFF && imgContent.charAt(i) == 0xD9); boolean jpgEnd = (i != 0) && (imgContent.charAt(i-1) == 0xFF && imgContent.charAt(i) == 0xD9);
if(!jpgIn && !jpgStart) {
jpgNamePiece += imgContent.charAt(i);
}
if(jpgStart) { if(jpgStart) {
jpgName = "" + imgContent.charAt(i-6)+imgContent.charAt(i-5)+imgContent.charAt(i-4) jpgName = jpgNamePiece;
+ imgContent.charAt(i-3)+imgContent.charAt(i-2)+imgContent.charAt(i-1); jpgNamePiece = "";
jpgIn = true; jpgIn = true;
} }

Loading…
Cancel
Save