Examples of HProfFile


Examples of org.apache.kato.hprof.datalayer.HProfFile

   
  }

  public void report(File dump) throws IOException {
   
    HProfFile h=HProfFactory.createReader(dump);
   
    h.open();
   
   
    int counter=0;
    while(true) {
      IHProfRecord record=h.getRecord(counter);
      if(record==null) break;
      report(record);
      counter++;
    }
   
 
    h.close();

   
  }
View Full Code Here

Examples of org.apache.kato.hprof.datalayer.HProfFile

    return realFile;
  }

  public HProfView getMinimalHProfView() throws IOException {
    File m=getMinimalHProfFile();
    HProfFile hprofFile=HProfFactory.createReader(m);
    hprofFile.open();
    return new HProfView(hprofFile);
 
  }
View Full Code Here

Examples of org.apache.kato.hprof.datalayer.HProfFile

  private static final String DUMP = "/data/java.hprof";
  public void testHeader() throws IOException,java.net.URISyntaxException {
    URL datafile=getClass().getResource(DUMP);
    URI i=datafile.toURI();
    File dump=new File(i);
    HProfFile h=HProfFactory.createReader(dump);
   
    h.open();
   
    String header=h.getHeader();
    int    idSize=h.getIdentifierSize();
    long   timeStamp=h.getTimeStamp();
   
    IHProfRecord record=h.getRecord(0);
    assertNotNull(record);
   
    System.out.println("tag="+Integer.toHexString(record.getTag()));
    h.close();
   
  }
View Full Code Here

Examples of org.apache.kato.hprof.datalayer.HProfFile

  public void testRead() throws IOException,java.net.URISyntaxException {
   
    URL datafile=getClass().getResource(DUMP);
    URI i=datafile.toURI();
    File dump=new File(i);
    HProfFile h=HProfFactory.createReader(dump);
   
    h.open();
    int records=h.getRecordCount();
    h.close();
    assertEquals(1526,records);
   
   
  }
View Full Code Here

Examples of org.apache.kato.hprof.datalayer.HProfFile

  public void testReadTwice() throws IOException,java.net.URISyntaxException {
   
    URL datafile=getClass().getResource(DUMP);
    URI uri=datafile.toURI();
    File dump=new File(uri);
    HProfFile h=HProfFactory.createReader(dump);
   
    h.open();
    int records=h.getRecordCount();
    for(int i=0;i<records;i++) {
      Object o=h.getRecord(i);
      assertNotNull("element "+i+" is null",o);
    }
    h.close();
   
   
   
  }
View Full Code Here

Examples of org.apache.kato.hprof.datalayer.HProfFile

   
  }

  public void report(File dump) throws IOException {
   
    HProfFile h=HProfFactory.createReader(dump);
   
    h.open();
   
    String header=h.getHeader();
    int    idSize=h.getIdentifierSize();
    long   timeStamp=h.getTimeStamp();
   
    out.println("HPROF     : "+header);
    out.println("ID SIZE  : "+idSize);
    out.println("TIMESTAMP: "+timeStamp);
   
    int counter=0;
    while(true) {
     
      IHProfRecord record=h.getRecord(counter);
      if(record==null) break;
      report(record);
      counter++;
    }
   
    reportStats();
    out.println("Report completed.  "+counter+" records");
   
    h.close();

   
  }
View Full Code Here

Examples of org.apache.kato.hprof.datalayer.HProfFile

  @Override
  public Image getImage(File imageFile, File metadata) throws IOException {
   
    if(imageFile==null) throw new IllegalArgumentException("image file is null");
    if(imageFile.exists()==false) throw new IllegalArgumentException("image file does not exist");
    HProfFile hprofFile=HProfFactory.createReader(imageFile);
   
    hprofFile.open();
    ImageImpl impl=new ImageImpl(hprofFile);
   
    return impl;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.