]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/CompressSection.java
1.Change environment variable from "Framework_Tools_Path" to "FRAMEWORK_TOOLS_PATH".
[mirror_edk2.git] / Tools / Source / FrameworkTasks / org / tianocore / framework / tasks / CompressSection.java
index 8def4ebc95908cfb4d9504415d2b514f500000ab..674c6c86676ce13eeaee4a5d72260c423e3802fb 100644 (file)
@@ -54,7 +54,7 @@ public class CompressSection implements Section, FfsTypes{
       @param Buffer     The point of output buffer\r
       \r
     **/\r
-    public void toBuffer (DataOutputStream Buffer){\r
+    public void toBuffer (DataOutputStream buffer, DataOutputStream orgBuffer){\r
         \r
         Section    sect;\r
         File       compressOut;\r
@@ -79,7 +79,7 @@ public class CompressSection implements Section, FfsTypes{
                 //  Call each section class's toBuffer function.\r
                 //\r
                 try {\r
-                    sect.toBuffer(Do);\r
+                    sect.toBuffer(Do, orgBuffer);\r
                 }\r
                 catch (BuildException e) {\r
                     System.out.print(e.getMessage());\r
@@ -121,7 +121,7 @@ public class CompressSection implements Section, FfsTypes{
             Ch.SectionHeader.type    = (byte) EFI_SECTION_COMPRESSION;\r
             \r
             //\r
-            //  Note: The compressName was not effective now. Using the\r
+            //  Note: The compressName was not efsfective now. Using the\r
             //  EFI_STANDARD_COMPRSSION for compressType .\r
             //  That is follow old Genffsfile tools. Some code will be added for \r
             //  the different compressName;\r
@@ -138,19 +138,26 @@ public class CompressSection implements Section, FfsTypes{
             //\r
             //  First add CompressHeader to Buffer, then add Compress data.\r
             //\r
-            Buffer.write (headerBuffer);\r
-            Buffer.write(myCompress.outputBuffer);            \r
+            buffer.write (headerBuffer);\r
+            buffer.write(myCompress.outputBuffer);            \r
                 \r
             //\r
-            //  4 Byte aligment \r
+            //  Buffer 4 Byte aligment \r
             //\r
             int size = Ch.GetSize() + myCompress.outputBuffer.length;\r
             \r
             while ((size & 0x03) != 0){\r
                 size ++;\r
-                Buffer.writeByte(0);\r
+                buffer.writeByte(0);\r
+            }\r
+            //\r
+            // orgBuffer 4 Byte aligment\r
+            //\r
+            size = (int)compressOut.length();\r
+            while ((size & 0x03) != 0){\r
+                size ++;\r
+                orgBuffer.writeByte(0);\r
             }\r
-            \r
             //\r
             //  Delete temp file\r
             //\r