Package org.aspectj.weaver
Class CompressingDataOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
org.aspectj.weaver.CompressingDataOutputStream
- All Implemented Interfaces:
Closeable,DataOutput,Flushable,AutoCloseable
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 Summary
FieldsFields inherited from class java.io.DataOutputStream
writtenFields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionCompressingDataOutputStream(ByteArrayOutputStream baos, ConstantPoolWriter constantPoolWriter) -
Method Summary
Modifier and TypeMethodDescriptionbooleanintcompressFilepath(String filepath)intcompressName(String name)intcompressSignature(String signature)voidwriteCompressedName(String name)voidwriteCompressedPath(String path)voidwriteCompressedSignature(String signature)Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFMethods inherited from class java.io.FilterOutputStream
close, writeMethods inherited from class java.io.OutputStream
nullOutputStreamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.io.DataOutput
write
-
Field Details
-
compressionEnabled
public boolean compressionEnabled
-
-
Constructor Details
-
CompressingDataOutputStream
public CompressingDataOutputStream(ByteArrayOutputStream baos, ConstantPoolWriter constantPoolWriter) -
CompressingDataOutputStream
-
-
Method Details
-
canCompress
public boolean canCompress() -
compressSignature
- Parameters:
signature- of the form 'La/b/c/d;'- Returns:
- the constant pool index
-
compressFilepath
- Parameters:
filepath- a file system path 'c:\a\b\c.txt' or '/a/b/c.txt'- Returns:
- the constant pool index
-
compressName
- Parameters:
name- a simple name (for example a method or field name)- Returns:
- the constant pool index
-
writeCompressedName
- Parameters:
name- a simple name (for example a method or field name)- Throws:
IOException
-
writeCompressedSignature
- Parameters:
signature- of the form 'La/b/c/d;'- Throws:
IOException
-
writeCompressedPath
- Parameters:
path- a file system path 'c:\a\b\c.txt' or '/a/b/c.txt'- Throws:
IOException
-