Class DumpArchiveUtil


  • class DumpArchiveUtil
    extends java.lang.Object
    Various utilities for dump archives.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private DumpArchiveUtil()
      Private constructor to prevent instantiation.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int calculateChecksum​(byte[] buffer)
      Calculate checksum for buffer.
      static int convert16​(byte[] buffer, int offset)
      Read 2-byte integer from buffer.
      static int convert32​(byte[] buffer, int offset)
      Read 4-byte integer from buffer.
      static long convert64​(byte[] buffer, int offset)
      Read 8-byte integer from buffer.
      (package private) static java.lang.String decode​(ZipEncoding encoding, byte[] b, int offset, int len)
      Decodes a byte array to a string.
      static int getIno​(byte[] buffer)
      Get the ino associated with this buffer.
      static boolean verify​(byte[] buffer)
      Verify that the buffer contains a tape segment header.
      • Methods inherited from class java.lang.Object

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

      • DumpArchiveUtil

        private DumpArchiveUtil()
        Private constructor to prevent instantiation.
    • Method Detail

      • calculateChecksum

        public static int calculateChecksum​(byte[] buffer)
        Calculate checksum for buffer.
        Parameters:
        buffer - buffer containing tape segment header
      • verify

        public static final boolean verify​(byte[] buffer)
        Verify that the buffer contains a tape segment header.
        Parameters:
        buffer -
      • getIno

        public static final int getIno​(byte[] buffer)
        Get the ino associated with this buffer.
        Parameters:
        buffer -
      • convert64

        public static final long convert64​(byte[] buffer,
                                           int offset)
        Read 8-byte integer from buffer.
        Parameters:
        buffer -
        offset -
        Returns:
        the 8-byte entry as a long
      • convert32

        public static final int convert32​(byte[] buffer,
                                          int offset)
        Read 4-byte integer from buffer.
        Parameters:
        buffer -
        offset -
        Returns:
        the 4-byte entry as an int
      • convert16

        public static final int convert16​(byte[] buffer,
                                          int offset)
        Read 2-byte integer from buffer.
        Parameters:
        buffer -
        offset -
        Returns:
        the 2-byte entry as an int
      • decode

        static java.lang.String decode​(ZipEncoding encoding,
                                       byte[] b,
                                       int offset,
                                       int len)
                                throws java.io.IOException
        Decodes a byte array to a string.
        Throws:
        java.io.IOException