Class VersionedDataInputStream

All Implemented Interfaces:
Closeable, DataInput, AutoCloseable

public class VersionedDataInputStream extends DataInputStream
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
  • Constructor Details

  • Method Details

    • getMajorVersion

      public int getMajorVersion()
    • getMinorVersion

      public int getMinorVersion()
    • getBuildstamp

      public long getBuildstamp()
    • setVersion

      public void setVersion(AjAttribute.WeaverVersionInfo version)
    • readUtf8

      public String readUtf8(int cpIndex)
    • canDecompress

      public boolean canDecompress()
    • isAtLeast169

      public boolean isAtLeast169()
    • readPath

      public String readPath() throws IOException
      Throws:
      IOException
    • readSignature

      public String readSignature() throws IOException
      Throws:
      IOException
    • readSignatureAsUnresolvedType

      public UnresolvedType readSignatureAsUnresolvedType() throws IOException
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • checkArrayLength

      public int checkArrayLength(int length) throws IOException
      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