Class TarHelper


  • public final class TarHelper
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      TarHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.io.InputStream readEntryAtPos​(java.io.FileInputStream fileInputStream, TarEntryDescription entryDescription)
      Gets an input stream for a specific tar entry.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TarHelper

        public TarHelper()
    • Method Detail

      • readEntryAtPos

        public static java.io.InputStream readEntryAtPos​(java.io.FileInputStream fileInputStream,
                                                         TarEntryDescription entryDescription)
                                                  throws java.io.IOException
        Gets an input stream for a specific tar entry. Entry size & entry name & digest are validated to ensure data coherence.
        Parameters:
        fileInputStream - file input stream of the tar file to read from. It is NOT closed by this method and must closed by caller.
        entryDescription - the tar entry description (file position, size, digest...)
        Returns:
        Tar entry input stream. Closing this input streams does NOT close inner fileInputStream.
        Throws:
        java.io.IOException - if any IO error occurs