소스정리

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

@ -70,6 +70,10 @@ abstract public class LayoutParser {
this.descriptor = descriptor;
}
/** .<br />
* @param dataObject , File
* @return
*/
public void setFileDefaultInfo(DataObject dataObject, File file) {
String filePath = file.getPath();
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) {
List<Integer> byteNums = new ArrayList();

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

Loading…
Cancel
Save