]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/Compress.java
Polished the build tools' screen output to be in a more coherent form
[mirror_edk2.git] / Tools / Source / FrameworkTasks / org / tianocore / framework / tasks / Compress.java
1 /** @file
2 Compress class.
3
4 This class is to call CompressDll.dll to compress section.
5
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
11
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.
14
15 **/
16
17 package org.tianocore.framework.tasks;
18
19 import java.io.File;
20
21 /**
22
23 This class is to call CompressDll.dll to compress section.
24
25 **/
26 public class Compress {
27 byte[] inputBuffer;
28 byte[] outputBuffer;
29 int size;
30
31 static {
32 String dllPath;
33
34 dllPath = GenFfsFileTask.path;
35 dllPath = dllPath +
36 File.separator +
37 "CompressDll.dll";
38
39 System.load(dllPath);
40 }
41
42 /**
43 CallCompress
44
45 This function is to call the compressDll.dll to compress the contents in
46 buffer.
47
48 @param inputBuffer The input buffer.
49 @param size The size of buffer in byte.
50 @param dllPath The compressDll.dll path.
51 @return The buffer contained the comrpessed input.
52 **/
53 public native byte[] CallCompress (byte[] inputBuffer, int size, String dllPath);
54
55 /**
56 Construct function
57
58 This function is to initialize the class member and call the compress
59 function.
60
61 @param inBuffer The input buffer.
62 @param size The size of buffer in byte.
63 **/
64 public Compress (byte[] inBuffer, int size){
65 this.inputBuffer = inBuffer;
66 this.size = size;
67 String path = GenFfsFileTask.path;
68
69 //
70 // Call Compress function.
71 //
72 this.outputBuffer = CallCompress (
73 this.inputBuffer,
74 this.size,
75 path
76 );
77 }
78 }