Class CompressingDataOutputStream

All Implemented Interfaces:
Closeable, DataOutput, Flushable, AutoCloseable

public class CompressingDataOutputStream extends DataOutputStream
A variation of a DataOutputStream that is linked to a constant pool writer. The linked constant pool can be used to compress objects into to simple index references into the constant pool. The corresponding decompression is done in the VersionedDataInputStream.
Author:
Andy Clement
  • Field Details

    • compressionEnabled

      public boolean compressionEnabled
  • Constructor Details

  • Method Details

    • canCompress

      public boolean canCompress()
    • compressSignature

      public int compressSignature(String signature)
      Parameters:
      signature - of the form 'La/b/c/d;'
      Returns:
      the constant pool index
    • compressFilepath

      public int compressFilepath(String filepath)
      Parameters:
      filepath - a file system path 'c:\a\b\c.txt' or '/a/b/c.txt'
      Returns:
      the constant pool index
    • compressName

      public int compressName(String name)
      Parameters:
      name - a simple name (for example a method or field name)
      Returns:
      the constant pool index
    • writeCompressedName

      public void writeCompressedName(String name) throws IOException
      Parameters:
      name - a simple name (for example a method or field name)
      Throws:
      IOException
    • writeCompressedSignature

      public void writeCompressedSignature(String signature) throws IOException
      Parameters:
      signature - of the form 'La/b/c/d;'
      Throws:
      IOException
    • writeCompressedPath

      public void writeCompressedPath(String path) throws IOException
      Parameters:
      path - a file system path 'c:\a\b\c.txt' or '/a/b/c.txt'
      Throws:
      IOException