Class VersionedDataInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.DataInputStream
org.aspectj.weaver.VersionedDataInputStream
- All Implemented Interfaces:
Closeable, DataInput, AutoCloseable
Lightweight subclass of DataInputStream that knows what version of the weaver was used to construct the data in it. The input
stream has a constant pool reader attached which enables it to decode constant pool references found within the data being read.
- Author:
- Andy Clement
-
Field Summary
Fields inherited from class FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionVersionedDataInputStream(ByteArrayInputStream bais, ConstantPoolReader constantPoolReader) -
Method Summary
Modifier and TypeMethodDescriptionbooleanintcheckArrayLength(int length) Checks a count that has just been read from the stream and is about to be used to size an array.longintintbooleanreadPath()readUtf8(int cpIndex) voidsetVersion(AjAttribute.WeaverVersionInfo version) toString()Methods inherited from class DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytesMethods inherited from class FilterInputStream
available, close, mark, markSupported, read, reset, skipMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
VersionedDataInputStream
-
-
Method Details
-
getMajorVersion
public int getMajorVersion() -
getMinorVersion
public int getMinorVersion() -
getBuildstamp
public long getBuildstamp() -
setVersion
-
readUtf8
-
canDecompress
public boolean canDecompress() -
isAtLeast169
public boolean isAtLeast169() -
readPath
- Throws:
IOException
-
readSignature
- Throws:
IOException
-
readSignatureAsUnresolvedType
- Throws:
IOException
-
toString
-
checkArrayLength
Checks a count that has just been read from the stream and is about to be used to size an array. Every element occupies at least one byte, so a count that is negative, crazy large, or bigger than the number of bytes remaining cannot be genuine and is rejected before anything is allocated. This relies on available() being exact, which is guaranteed now the constructor takes a ByteArrayInputStream.- Throws:
IOException
-