Package xmlconvertor

Source Code of xmlconvertor.TarEntryGenerator

package xmlconvertor;

import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;

import java.io.IOException;

/**
* Created by IntelliJ IDEA.
* User: diez
* Date: 1/7/11
* Time: 9:40 PM
* To change this template use File | Settings | File Templates.
*/
public class TarEntryGenerator {
    public static void generateTarArchiveEntry(TarArchiveOutputStream tOut, byte[] fileContent, String entryName) throws IOException {
         TarArchiveEntry tarEntry = new TarArchiveEntry(entryName);
         tarEntry.setSize(fileContent.length);

         tOut.putArchiveEntry(tarEntry);
         tOut.write(fileContent);
         tOut.closeArchiveEntry();
    }}
TOP

Related Classes of xmlconvertor.TarEntryGenerator

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.