4 GenFfsFileTaks is to generate ffs file.
6 Copyright (c) 2006, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 package org
.tianocore
.framework
.tasks
;
18 import java
.io
.DataInputStream
;
19 import java
.io
.DataOutputStream
;
21 import java
.io
.FileInputStream
;
22 import java
.io
.FileOutputStream
;
23 import java
.util
.ArrayList
;
24 import java
.util
.Iterator
;
25 import java
.util
.List
;
27 import org
.apache
.tools
.ant
.BuildException
;
28 import org
.apache
.tools
.ant
.Project
;
29 import org
.apache
.tools
.ant
.Task
;
34 GenFfsFileTaks is to generate ffs file.
37 public class GenFfsFileTask
extends Task
implements EfiDefine
, FfsTypes
{
39 * GenFfsFile Task Class
41 * -baseName : module baseName
42 * -ffsFileGuid : module Guid.
43 * -ffsFileType : Ffs file type.
44 * -ffsAttributeRecovery : The file is required for recovery.
45 * -ffsAligment : The file data alignment (0 if none required). See FFS
46 * specification for supported alignments (0-7 are only possible
48 * -ffsAttributeCheckSum : The file data is checksummed. If this is FALSE a
49 * value of 0x5A will be inserted in the file
50 * checksum field of the file header. *
51 * -sectFileDir : specifies the full path to the component build directory.
53 * -ffsAttrib : Data recorde attribute added result.
54 * -sectionList : List recorded all section elemet in task.
63 String ffsFileGuid
= "";
67 String ffsFileType
= "";
69 /// ffsAttribHeaderExtension value is used to set the corresponding bit in
70 /// the output FFS file header
72 boolean ffsAttribHeaderExtension
= false;
74 /// ffsAttribTailPresent value is used to set the corresponding bit in the
75 /// output FFS file header
77 boolean ffsAttribTailPresent
= false;
79 /// ffsAttribRecovery value is used to set the corresponding bit in the
80 /// output FFS file header
82 boolean ffsAttribRecovery
= false;
84 /// ffsAligenment value is used to set the corresponding bit in the output
85 /// FFS file header.The specified FFS alignment must be a value between 0
90 /// ffsAttribChecksum value is used to set the corresponding bit in the
91 /// output FFS file header
93 boolean FfsAttribChecksum
= false;
95 /// Attribute is used to record the sum of all bit in the output FFS file.
99 /// The output directory of ffs file.
101 String outputDir
= "";
105 List
<Object
> sectionList
= new ArrayList
<Object
>();
108 /// The path of Framewor_Tools_Paht.
110 static String path
= "";
115 GenFfsFileTask execute is to generate ffs file according to input section
116 dscriptive information.
118 public void execute() throws BuildException
{
126 FfsHeader ffsHeader
= new FfsHeader();
127 FfsHeader orgFfsHeader
= new FfsHeader();
128 String ffsSuffix
= "";
129 String outputPath
= "";
132 // Get Fraemwork_Tools_Path
134 Project pj
= this.getOwningTarget().getProject();
135 path
= pj
.getProperty("env.FRAMEWORK_TOOLS_PATH");
138 // Check does the BaseName, Guid, FileType set value.
140 if (this.baseName
.equals("")) {
141 throw new BuildException ("Must set BaseName!\n");
144 if (this.ffsFileGuid
.equals("")) {
145 throw new BuildException ("Must set ffsFileGuid!\n");
148 if (this.ffsFileType
.equals("")) {
149 throw new BuildException ("Must set ffsFileType!\n");
153 // Create ffs file. File name = FfsFileGuid + BaseName + ffsSuffix.
154 // If outputDir's value was set, file will output to the outputDir.
156 ffsSuffix
= TypeToSuffix (this.ffsFileType
);
157 if (!this.outputDir
.equals("")) {
159 outputPath
= this.outputDir
;
160 temp
= outputPath
.replace('\\', File
.separatorChar
);
161 outputPath
= temp
.replace('/', File
.separatorChar
);
162 if (outputPath
.charAt(outputPath
.length()-1) != File
.separatorChar
) {
163 outputPath
= outputPath
+ File
.separator
;
168 ffsFile
= new File (outputPath
+ this.ffsFileGuid
+ '-' + this.baseName
+ ffsSuffix
);
169 System
.out
.print("General Ffs file: file name is:\n");
170 System
.out
.print(outputPath
+ this.ffsFileGuid
+ '-' + this.baseName
+ ffsSuffix
);
171 System
.out
.print("\n");
174 // Create ffs ORG file. fileName = FfsFileGuid + BaseName + ffsSuffix +
177 ffsOrgFile
= new File(outputPath
+ this.ffsFileGuid
+ '-' + this.baseName
+ ffsSuffix
+ ".org");
181 // Create file output stream -- dataBuffer.
183 FileOutputStream dataFs
= new FileOutputStream (ffsFile
.getAbsolutePath());
184 DataOutputStream dataBuffer
= new DataOutputStream (dataFs
);
187 // Create org file output stream -- orgDataBuffer
189 FileOutputStream orgDataFs
= new FileOutputStream (ffsOrgFile
.getAbsolutePath());
190 DataOutputStream orgDataBuffer
= new DataOutputStream (orgDataFs
);
193 // Search SectionList find earch section and call it's
194 // ToBuffer function.
196 Iterator sectionIter
= this.sectionList
.iterator();
197 while (sectionIter
.hasNext()) {
198 sect
= (Section
)sectionIter
.next();
202 // The last section don't need 4 byte ffsAligment.
204 sect
.toBuffer((DataOutputStream
)dataBuffer
, (DataOutputStream
) orgDataBuffer
);
205 } catch (Exception e
) {
206 throw new BuildException (e
.getMessage());
210 orgDataBuffer
.close();
211 } catch (Exception e
) {
212 throw new BuildException (e
.getMessage());
216 // Creat Ffs file header
221 // create input stream to read file data
223 byte[] fileBuffer
= new byte[(int)ffsFile
.length()];
224 FileInputStream fi
= new FileInputStream (ffsFile
.getAbsolutePath());
225 DataInputStream di
= new DataInputStream (fi
);
230 // create input org stream to read file data
232 byte[] orgFileBuffer
= new byte[(int)ffsOrgFile
.length()];
233 FileInputStream ofi
= new FileInputStream (ffsOrgFile
.getAbsolutePath());
234 DataInputStream odi
= new DataInputStream (ofi
);
235 odi
.read(orgFileBuffer
);
239 // Add GUID to header struct
241 if (this.ffsFileGuid
!= null) {
242 stringToGuid (this.ffsFileGuid
, ffsHeader
.name
);
244 // Add Guid to org header struct
246 stringToGuid (this.ffsFileGuid
, orgFfsHeader
.name
);
249 ffsHeader
.ffsAttributes
= this.attributes
;
250 if ((ffsHeader
.fileType
= stringToType(this.ffsFileType
))== -1) {
251 throw new BuildException ("FFS_FILE_TYPE unknow!\n");
255 // Copy ffsHeader.ffsAttribute and fileType to orgFfsHeader.ffsAttribute
258 orgFfsHeader
.ffsAttributes
= ffsHeader
.ffsAttributes
;
259 orgFfsHeader
.fileType
= ffsHeader
.fileType
;
262 // Adjust file size. The function is used to tripe the last
263 // section padding of 4 binary boundary.
266 if (ffsHeader
.fileType
!= EFI_FV_FILETYPE_RAW
) {
268 fileDataSize
= adjustFileSize (fileBuffer
);
269 orgFileDataSize
= adjustFileSize (orgFileBuffer
);
272 fileDataSize
= fileBuffer
.length
;
273 orgFileDataSize
= orgFileBuffer
.length
;
277 // 1. add header size to file size
279 fileSize
= fileDataSize
+ ffsHeader
.getSize();
281 // add header size to org file size
283 orgFileSize
= orgFileDataSize
+ ffsHeader
.getSize();
285 if ((ffsHeader
.ffsAttributes
& FFS_ATTRIB_TAIL_PRESENT
) != 0) {
286 if (ffsHeader
.fileType
== EFI_FV_FILETYPE_FFS_PAD
) {
288 throw new BuildException (
289 "FFS_ATTRIB_TAIL_PRESENT=TRUE is " +
290 "invalid for PAD files"
293 if (fileSize
== ffsHeader
.getSize()) {
294 throw new BuildException (
295 "FFS_ATTRIB_TAIL_PRESENT=TRUE is " +
296 "invalid for 0-length files"
299 fileSize
= fileSize
+ 2;
300 orgFileSize
= orgFileSize
+ 2;
304 // 2. set file size to header struct
306 ffsHeader
.ffsFileSize
[0] = (byte)(fileSize
& 0x00FF);
307 ffsHeader
.ffsFileSize
[1] = (byte)((fileSize
& 0x00FF00)>>8);
308 ffsHeader
.ffsFileSize
[2] = (byte)(((int)fileSize
& 0xFF0000)>>16);
311 // set file size to org header struct
313 orgFfsHeader
.ffsFileSize
[0] = (byte)(orgFileSize
& 0x00FF);
314 orgFfsHeader
.ffsFileSize
[1] = (byte)((orgFileSize
& 0x00FF00)>>8);
315 orgFfsHeader
.ffsFileSize
[2] = (byte)(((int)orgFileSize
& 0xFF0000)>>16);
318 // Fill in checksums and state, these must be zero for checksumming
320 ffsHeader
.integrityCheck
.header
= calculateChecksum8 (
321 ffsHeader
.structToBuffer(),
325 // Fill in org file's header check sum and state
327 orgFfsHeader
.integrityCheck
.header
= calculateChecksum8 (
328 orgFfsHeader
.structToBuffer(),
329 orgFfsHeader
.getSize()
332 if ((this.attributes
& FFS_ATTRIB_CHECKSUM
) != 0) {
333 if ((this.attributes
& FFS_ATTRIB_TAIL_PRESENT
) != 0) {
334 ffsHeader
.integrityCheck
.file
= calculateChecksum8 (
339 // Add org file header
341 orgFfsHeader
.integrityCheck
.file
= calculateChecksum8 (
346 ffsHeader
.integrityCheck
.file
= calculateChecksum8 (
351 // Add org file header
353 orgFfsHeader
.integrityCheck
.file
= calculateChecksum8 (
359 ffsHeader
.integrityCheck
.file
= FFS_FIXED_CHECKSUM
;
360 orgFfsHeader
.integrityCheck
.file
= FFS_FIXED_CHECKSUM
;
364 // Set the state now. Spec says the checksum assumes the state is 0.
366 ffsHeader
.ffsState
= EFI_FILE_HEADER_CONSTRUCTION
|
367 EFI_FILE_HEADER_VALID
|
369 orgFfsHeader
.integrityCheck
.file
= ffsHeader
.ffsState
;
372 // create output stream to first write header data in file, then write sect data in file.
374 FileOutputStream headerFfs
= new FileOutputStream (ffsFile
.getAbsolutePath());
375 DataOutputStream ffsBuffer
= new DataOutputStream (headerFfs
);
377 FileOutputStream orgHeaderFfs
= new FileOutputStream (ffsOrgFile
.getAbsolutePath());
378 DataOutputStream orgFfsBuffer
= new DataOutputStream (orgHeaderFfs
);
381 // Add header struct and file data to FFS file
383 ffsBuffer
.write(ffsHeader
.structToBuffer());
384 orgFfsBuffer
.write(orgFfsHeader
.structToBuffer());
386 for (int i
= 0; i
< fileDataSize
; i
++) {
387 ffsBuffer
.write(fileBuffer
[i
]);
390 for (int i
= 0; i
< orgFileDataSize
; i
++){
391 orgFfsBuffer
.write(orgFileBuffer
[i
]);
395 // If there is a tail, then set it
397 if ((this.attributes
& FFS_ATTRIB_TAIL_PRESENT
) != 0) {
399 byte [] tailByte
= new byte[2];
402 // reverse tailvalue , integritycheck.file as hight byte, and
403 // integritycheck.header as low byte.
405 tailValue
= (short)(ffsHeader
.integrityCheck
.header
& 0xff);
406 tailValue
= (short)((tailValue
) | ((ffsHeader
.integrityCheck
.file
<< 8) & 0xff00));
407 tailValue
= (short)~tailValue
;
410 // Change short to byte[2]
412 tailByte
[0] = (byte)(tailValue
& 0xff);
413 tailByte
[1] = (byte)((tailValue
& 0xff00)>>8);
414 ffsBuffer
.write(tailByte
[0]);
415 ffsBuffer
.write(tailByte
[1]);
417 orgFfsBuffer
.write(tailByte
[0]);
418 orgFfsBuffer
.write(tailByte
[1]);
422 // close output stream. Note if don't close output stream
423 // the buffer can't be rewritten to file.
426 orgFfsBuffer
.close();
427 System
.out
.print ("Successful create ffs file!\n");
428 } catch (Exception e
) {
429 throw new BuildException (e
.getMessage());
436 This function is to add compress section to section list.
437 @param compress Section of compress
439 public void addCompress(CompressSection compress
) {
440 this.sectionList
.add(compress
);
446 This function is to add tool section to section list.
447 @param tool Section of tool
449 public void addTool(Tool tool
) {
450 this.sectionList
.add(tool
);
456 This function is to add sectFile section to section list.
457 @param sectFile Section of sectFile.
459 public void addSectFile (SectFile sectFile
) {
460 this.sectionList
.add(sectFile
);
466 This function is to get basename
468 @return String of base name
470 public String
getBaseName() {
471 return this.baseName
;
477 This function is to set base name.
480 public void setBaseName(String baseName
) {
481 this.baseName
= baseName
.trim();
487 This function is to get the ffsAligment
488 @return The value of ffsAligment.
490 public int getFfsAligment() {
491 return this.ffsAlignment
;
497 This function is to set ffsAligment
498 @param ffsAligment The value of ffsAligment.
500 public void setFfsAligment(int ffsAligment
) {
501 this.ffsAlignment
= ffsAligment
;
502 if (this.ffsAlignment
> 7) {
503 throw new BuildException ("FFS_ALIGMENT Scope is 0-7");
505 attributes
|= (((byte)this.ffsAlignment
) << 3);
512 This function is to get ffsAttribCheckSum
514 @return Value of ffsAttribChecksum
516 public boolean getFfsAttribChecksum() {
517 return this.FfsAttribChecksum
;
523 This function is to set ffsAttribChecksum
524 @param ffsAttributeCheckSum Value of ffsAttribCheckSum
526 public void setFfsAttribChecksum(boolean ffsAttributeCheckSum
) {
527 this.FfsAttribChecksum
= ffsAttributeCheckSum
;
528 if (ffsAttributeCheckSum
) {
529 attributes
|= FFS_ATTRIB_CHECKSUM
;
536 This function is to get ffsAttribRecovery
537 @return Value of ffsAttribRecovery
539 public boolean getFfsAttribRecovery() {
540 return this.ffsAttribRecovery
;
546 This function is to set ffsAttributeRecovery
548 @param ffsAttributeRecovery Value of ffsAttributeRecovery
550 public void setRecovery(boolean ffsAttributeRecovery
) {
551 this.ffsAttribRecovery
= ffsAttributeRecovery
;
552 if (ffsAttributeRecovery
) {
553 attributes
|= FFS_ATTRIB_RECOVERY
;
560 This function is to get fileGuid
563 public String
getFileGuid() {
564 return this.ffsFileGuid
;
570 This function is to set fileGuid
571 @param ffsFileGuid String of GUID
573 public void setFileGuid(String ffsFileGuid
) {
574 this.ffsFileGuid
= ffsFileGuid
.trim();
580 This function is to get ffsFileType.
582 @return value of ffsFileType
584 public String
getFfsFileType() {
585 return this.ffsFileType
;
591 This function is to set ffsFileType.
595 public void setFfsFileType(String ffsFileType
) {
596 this.ffsFileType
= ffsFileType
.trim();
600 ffsAttribHeaderExtension
602 This function is to get ffsAttribHeaderExtension
604 @return Value of ffsAttribHeaderExtension
606 public boolean isFfsAttribHeaderExtension() {
607 return this.ffsAttribHeaderExtension
;
613 This function is to set headerExtension
614 @param headerExtension Value of headerExension
616 public void setHeaderExtension(boolean headerExtension
) {
617 this.ffsAttribHeaderExtension
= headerExtension
;
618 if (headerExtension
) {
619 attributes
|= FFS_ATTRIB_HEADER_EXTENSION
;
624 isFfsAttribTailPresent
626 This function is to get ffsAttribTailPresent value.
627 @return Value of ffsAttribTailPresent.
629 public boolean isFfsAttribTailPresent() {
630 return this.ffsAttribTailPresent
;
634 setFfsAttribTailPresent
636 This function is to set ffsAttribTailPresent.
637 @param tailPresent Value of ffsAttribTailPresent.
639 public void setFfsAttribTailPresent(boolean tailPresent
) {
640 this.ffsAttribTailPresent
= tailPresent
;
642 attributes
|= FFS_ATTRIB_TAIL_PRESENT
;
650 This function is to convert string to GUID.
651 * @param GuidStr String of GUID.
652 * @param Guid GUID form.
654 private void stringToGuid (String GuidStr
, FfsHeader
.FfsGuid Guid
){
662 byte[] buffer
= new byte[16];
663 if (GuidStr
.length()!=36) {
664 throw new BuildException ("Guid length is not correct!");
668 SplitStr
= GuidStr
.split("-");
669 if (SplitStr
.length
!= 5) {
670 throw new BuildException ("Guid type is not correct!");
675 for (i
= 0; i
< SplitStr
.length
; i
++) {
676 String str
= SplitStr
[i
];
677 charArry
= str
.toCharArray();
679 for (j
=0; j
< (str
.toCharArray().length
)/2; j
++) {
681 buffer
[k
] = hexCharToByte (charArry
[j
*2]);
682 buffer
[k
] = (byte)( buffer
[k
]& 0x0f);
683 buffer
[k
] = (byte)((buffer
[k
]<< 4));
684 buffer
[k
] = (byte)( buffer
[k
]& 0xf0);
685 buffer
[k
] = (byte)( buffer
[k
]|hexCharToByte(charArry
[j
*2+1]));
689 Guid
.bufferToStruct(buffer
);
695 This function is to get suffix of ffs file according to ffsFileType.
697 @param ffsFileType ffsFileType
698 @return The suffix of ffs file
700 private String
TypeToSuffix (String ffsFileType
){
701 if (ffsFileType
.equals("EFI_FV_FILETYPE_ALL")) {
704 if (ffsFileType
.equals("EFI_FV_FILETYPE_RAW")) {
705 return EFI_FV_FFS_FILETYPE_STR
;
707 if (ffsFileType
.equals("EFI_FV_FILETYPE_FREEFORM")) {
708 return EFI_FV_FFS_FILETYPE_STR
;
710 if (ffsFileType
.equals("EFI_FV_FILETYPE_SECURITY_CORE")) {
711 return EFI_FV_SEC_FILETYPE_STR
;
713 if (ffsFileType
.equals("EFI_FV_FILETYPE_PEI_CORE")) {
714 return EFI_FV_PEI_FILETYPE_STR
;
716 if (ffsFileType
.equals("EFI_FV_FILETYPE_DXE_CORE")) {
717 return EFI_FV_DXE_FILETYPE_STR
;
719 if (ffsFileType
.equals("EFI_FV_FILETYPE_PEIM")) {
720 return EFI_FV_PEI_FILETYPE_STR
;
722 if (ffsFileType
.equals("EFI_FV_FILETYPE_DRIVER")) {
723 return EFI_FV_DXE_FILETYPE_STR
;
725 if (ffsFileType
.equals("EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER")) {
726 return EFI_FV_PEI_FILETYPE_STR
;
728 if (ffsFileType
.equals("EFI_FV_FILETYPE_APPLICATION")) {
729 return EFI_FV_APP_FILETYPE_STR
;
731 if (ffsFileType
.equals("EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE")) {
732 return EFI_FV_FVI_FILETYPE_STR
;
734 if (ffsFileType
.equals("EFI_FV_FILETYPE_FFS_PAD")) {
735 return EFI_FV_FFS_FILETYPE_STR
;
744 This function is to get ffsFileType integer value according to ffsFileType.
745 @param ffsFileType String value of ffsFileType
746 @return Integer value of ffsFileType.
748 private byte stringToType (String ffsFileType
){
750 if (ffsFileType
.equals("EFI_FV_FILETYPE_ALL")) {
751 return(byte)EFI_FV_FILETYPE_ALL
;
754 if (ffsFileType
.equals("EFI_FV_FILETYPE_RAW")) {
755 return(byte)EFI_FV_FILETYPE_RAW
;
758 if (ffsFileType
.equals("EFI_FV_FILETYPE_FREEFORM")) {
759 return(byte)EFI_FV_FILETYPE_FREEFORM
;
762 if (ffsFileType
.equals("EFI_FV_FILETYPE_SECURITY_CORE")) {
763 return(byte)EFI_FV_FILETYPE_SECURITY_CORE
;
766 if (ffsFileType
.equals("EFI_FV_FILETYPE_PEI_CORE")) {
767 return(byte) EFI_FV_FILETYPE_PEI_CORE
;
770 if (ffsFileType
.equals("EFI_FV_FILETYPE_DXE_CORE")) {
771 return(byte)EFI_FV_FILETYPE_DXE_CORE
;
774 if (ffsFileType
.equals("EFI_FV_FILETYPE_PEIM")) {
775 return(byte)EFI_FV_FILETYPE_PEIM
;
778 if (ffsFileType
.equals("EFI_FV_FILETYPE_DRIVER")) {
779 return(byte) EFI_FV_FILETYPE_DRIVER
;
782 if (ffsFileType
.equals("EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER")) {
783 return(byte)EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER
;
786 if (ffsFileType
.equals("EFI_FV_FILETYPE_APPLICATION")) {
787 return(byte)EFI_FV_FILETYPE_APPLICATION
;
790 if (ffsFileType
.equals("EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE")) {
791 return(byte)EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
;
793 if (ffsFileType
.equals("EFI_FV_FILETYPE_FFS_PAD")) {
794 return(byte) EFI_FV_FILETYPE_FFS_PAD
;
805 This function is to calculate the value needed for a valid UINT8 checksum
806 @param buffer Byte buffer containing byte data of component.
807 @param size Size of the buffer.
808 @return The 8 bit checksum value needed.
810 private byte calculateChecksum8 (byte[] buffer
, int size
){
811 return(byte) (0x100 - calculateSum8 (buffer
, size
));
818 This function is to calculate the UINT8 sum for the requested region.
819 @param buffer Byte buffer containing byte data of component
820 @param size Size of the buffer.
821 @return The 8 bit checksum value needed.
823 private short calculateSum8 (byte[] buffer
, int size
){
829 // Perform the word sum for buffer
831 for (Index
= 0; Index
< size
; Index
++) {
832 Sum
= (byte) (Sum
+ buffer
[Index
]);
841 This function is to convert hex character to byte
843 @param hexChar hex character
844 @return Byte which corresponding to the character.
846 private byte hexCharToByte (char hexChar
){
897 This function is used to adjusts file size to insure sectioned file is exactly the right length such
898 that it ends on exactly the last byte of the last section. ProcessScript()
899 may have padded beyond the end of the last section out to a 4 byte boundary.
900 This padding is stripped.
902 @param buffer Byte buffer contains a section stream
903 @return Corrected size of file.
905 private int adjustFileSize (byte[] buffer
){
907 int orignalLen
= buffer
.length
;
909 int sectionPoint
= 0;
910 int nextSectionPoint
= 0;
913 int firstSectionHeader
= 0;
916 firstSectionHeader
= buffer
[0]& 0xff;
917 firstSectionHeader
= ((buffer
[1]&0xff)<<8) | firstSectionHeader
;
918 firstSectionHeader
= ((buffer
[2]&0xff)<<16)| firstSectionHeader
;
921 while (sectionPoint
< buffer
.length
) {
922 sectionLen
= buffer
[0 + sectionPoint
]& 0xff;
923 sectionLen
= ((buffer
[1 + sectionPoint
]&0xff)<<8)| sectionLen
;
924 sectionLen
= ((buffer
[2 + sectionPoint
]&0xff)<<16)| sectionLen
;
925 totalLen
= totalLen
+ sectionLen
;
927 if (totalLen
== orignalLen
) {
931 sectionPoint
= sectionPoint
+ sectionLen
;
932 adjustLen
= sectionPoint
;
934 nextSectionPoint
= (sectionPoint
+ 0x03) & (~
0x03);
935 totalLen
= totalLen
+ nextSectionPoint
- sectionLen
;
936 sectionPoint
= nextSectionPoint
;
944 This function is to get output directory.
946 @return Path of output directory.
948 public String
getOutputDir() {
955 This function is to set output directory.
957 @param outputDir The output direcotry.
959 public void setOutputDir(String outputDir
) {
960 this.outputDir
= outputDir
;