Class ArcRecordUtils


  • public final class ArcRecordUtils
    extends Object
    Utilities for working with ARCRecords (from archive.org APIs).
    • Method Detail

      • fromBytes

        public static org.archive.io.arc.ARCRecord fromBytes​(byte[] bytes)
                                                      throws IOException
        Converts raw bytes into an ARCRecord.
        Parameters:
        bytes - raw bytes
        Returns:
        parsed ARCRecord
        Throws:
        IOException - if there is an issue
      • toBytes

        public static byte[] toBytes​(org.archive.io.arc.ARCRecord record)
                              throws IOException
        Converts ARC record into raw bytes.
        Parameters:
        record - conents of WARC response record
        Returns:
        raw contents
        Throws:
        IOException - if there is an issue
      • getContent

        public static byte[] getContent​(org.archive.io.arc.ARCRecord record)
                                 throws IOException
        Extracts raw contents from an ARCRecord (including HTTP headers).
        Parameters:
        record - the ARCRecord
        Returns:
        raw contents
        Throws:
        IOException - if there is an issue
      • getBodyContent

        public static byte[] getBodyContent​(org.archive.io.arc.ARCRecord record)
                                     throws IOException
        Extracts contents of the body from an ARCRecord. Excludes HTTP headers.
        Parameters:
        record - the ARCRecord
        Returns:
        contents of the body
        Throws:
        IOException - if there is an issue