code: public static JavaMetadata instance( InputStream inputStream,
                                           long length,
                                           String encoding ) throws IOException {
  
          JavaMetadata javaMetadata = new JavaMetadata();
          char[] source = JavaMetadataUtil.getJavaSourceFromTheInputStream(inputStream, length, encoding);
  
          CompilationUnit unit = (CompilationUnit)CompilationUnitParser.runJLS3Conversion(source, true);
          if (unit != null) {
              javaMetadata.packageMetadata = javaMetadata.createPackageMetadata(unit);
              javaMetadata.imports = javaMetadata.createImportMetadata(unit);
              javaMetadata.types = javaMetadata.createTypeMetadata(unit);
  
          }
  
          return javaMetadata;
      }
docs: Creates a new instance of <code>JavaMetadata</code>, that will be used to get informations of a compilation unit.
  
  @param inputStream - the <code>InputStream</code> in our case a <code>FileInputStream</code> of the java file.
  @param length - the length of the java file.
  @param encoding - the encoding that can be used.
  @return the new instace of <code>JavaMetadata</code>
  @see java.io.File#length()
  @throws java.io.IOException if the input stream cannot be parsed