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
Fields inherited from class java.io.DataOutputStream
written
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorDescriptionCompressingDataOutputStream
(ByteArrayOutputStream baos, ConstantPoolWriter constantPoolWriter) -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
compressFilepath
(String filepath) int
compressName
(String name) int
compressSignature
(String signature) void
writeCompressedName
(String name) void
writeCompressedPath
(String path) void
writeCompressedSignature
(String signature) Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
Methods inherited from class java.io.FilterOutputStream
close, write
Methods inherited from class java.io.OutputStream
nullOutputStream
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-