Package proguard.io

Class DataEntryCopier

java.lang.Object
proguard.io.DataEntryCopier
All Implemented Interfaces:
DataEntryReader
Direct Known Subclasses:
DataEntryRewriter

public class DataEntryCopier extends Object implements DataEntryReader
This DataEntryReader writes the ZIP entries and files that it reads to a given DataEntryWriter.
  • Constructor Details

    • DataEntryCopier

      public DataEntryCopier(DataEntryWriter dataEntryWriter)
      Creates a new DataEntryCopier.
  • Method Details

    • read

      public void read(DataEntry dataEntry) throws IOException
      Description copied from interface: DataEntryReader
      Reads the given data entry.
      Specified by:
      read in interface DataEntryReader
      Throws:
      IOException
    • copyData

      protected void copyData(InputStream inputStream, OutputStream outputStream) throws IOException
      Copies all data that it can read from the given input stream to the given output stream. The caller of this method will open and afterwards flush and close the input stream and the output stream. The implementation of this method needs to make sure that any wrapping output streams are flushed before returning.
      Throws:
      IOException
    • main

      public static void main(String[] args)
      A main method for testing file/archive/directory copying.