类 LZW


  • public class LZW
    extends java.lang.Object
    The LZW class provides static methods for compressing and expanding a binary input using LZW compression over the 8-bit extended ASCII alphabet with 12-bit codewords.

    For additional documentation, see Section 5.5 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

    • 方法概要

      修饰符和类型 方法 说明
      static void compress()
      Reads a sequence of 8-bit bytes from standard input; compresses them using LZW compression with 12-bit codewords; and writes the results to standard output.
      static void expand()
      Reads a sequence of bit encoded using LZW compression with 12-bit codewords from standard input; expands them; and writes the results to standard output.
      static void main​(java.lang.String[] args)
      Sample client that calls compress() if the command-line argument is "-" an expand() if it is "+".
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • compress

        public static void compress()
        Reads a sequence of 8-bit bytes from standard input; compresses them using LZW compression with 12-bit codewords; and writes the results to standard output.
      • expand

        public static void expand()
        Reads a sequence of bit encoded using LZW compression with 12-bit codewords from standard input; expands them; and writes the results to standard output.
      • main

        public static void main​(java.lang.String[] args)
        Sample client that calls compress() if the command-line argument is "-" an expand() if it is "+".
        参数:
        args - the command-line arguments