fr.umlv.corosol.classfile.io.impl
Class JClassFileInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.DataInputStream
              extended by fr.umlv.corosol.classfile.io.impl.JClassFileInputStream
All Implemented Interfaces:
JClassFileInput, JObject, java.io.Closeable, java.io.DataInput

public class JClassFileInputStream
extends java.io.DataInputStream
implements JClassFileInput

The default implementation of the fr.umlv.corosol.classfile.JClassFileInput interface.

Author:
Christophe Deleray

Constructor Summary
JClassFileInputStream(java.io.InputStream in)
          Creates a new class file input stream.
 
Method Summary
 JConstantPool getConstantPool()
          Returns the constant pool created by this classfile reader.
 JAttribute readAttribute()
          Reads an attributes from the classfile.
 JClassFileItem readClassFileItem(java.lang.Class type)
          Reads the class file item specified by its type.
 JClassMember readClassMember()
          Reads a class member description from the classfile.
 JConstant readConstant()
          Reads a constant pool entry from the classfile.
 JConstantPool readConstantPool()
          Reads the constant pool from the classfile.
 
Methods inherited from class java.io.DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes
 

Constructor Detail

JClassFileInputStream

public JClassFileInputStream(java.io.InputStream in)
Creates a new class file input stream.

Method Detail

readConstant

public JConstant readConstant()
                       throws java.io.IOException
Reads a constant pool entry from the classfile.

Specified by:
readConstant in interface JClassFileInput
Returns:
a constant pool entry
Throws:
java.io.IOException - if an I/O error occurs when reading this constant pool entry

readConstantPool

public JConstantPool readConstantPool()
                               throws java.io.IOException
Reads the constant pool from the classfile.

Specified by:
readConstantPool in interface JClassFileInput
Returns:
the constant pool
Throws:
java.io.IOException - if an I/O error occurs when reading the constant pool

readAttribute

public JAttribute readAttribute()
                         throws java.io.IOException
Reads an attributes from the classfile.

Specified by:
readAttribute in interface JClassFileInput
Returns:
an attribute
Throws:
java.io.IOException - if an I/O error occurs when reading this attribute

readClassMember

public JClassMember readClassMember()
                             throws java.io.IOException
Reads a class member description from the classfile.

Specified by:
readClassMember in interface JClassFileInput
Returns:
a class member description
Throws:
java.io.IOException - if an I/O error occurs when reading this class member description

readClassFileItem

public JClassFileItem readClassFileItem(java.lang.Class type)
                                 throws java.io.IOException
Reads the class file item specified by its type.

Specified by:
readClassFileItem in interface JClassFileInput
Parameters:
type - the type of a class file item to be readed from the classfile
Returns:
the corresponding class item
Throws:
java.io.IOException - if an I/O error occurs when reading this classfile item

getConstantPool

public JConstantPool getConstantPool()
Returns the constant pool created by this classfile reader.

Specified by:
getConstantPool in interface JClassFileInput
Returns:
the constant pool created by this classfile reader