Package org.apache.poi.hslf.record

Examples of org.apache.poi.hslf.record.Record


  int indent = depth;
  String ind = "";
  for(int i=0; i<indent; i++) { ind += " "; }

  for(int i=0; i<records.length; i++) {
    Record r = records[i];
    if (r == null) {
      System.out.println(ind + "At position " + pos + " (" + makeHex(pos,6) + "):");
      System.out.println(ind + "Warning! Null record found.");
      continue;
    }

    // Figure out how big it is
    int len = getDiskLen(r);
   
    // Grab the type as hex
    String hexType = makeHex((int)r.getRecordType(),4);
    String rHexType = reverseHex(hexType);

    // Grab the hslf.record type
    Class c = r.getClass();
    String cname = c.toString();
    if(cname.startsWith("class ")) {
      cname = cname.substring(6);
    }
    if(cname.startsWith("org.apache.poi.hslf.record.")) {
      cname = cname.substring(27);
    }

    // Display the record
    System.out.println(ind + "At position " + pos + " (" + makeHex(pos,6) + "):");
    System.out.println(ind + " Record is of type " + cname);
    System.out.println(ind + " Type is " + r.getRecordType() + " (" + hexType + " -> " + rHexType + " )");
    System.out.println(ind + " Len is " + (len-8) + " (" + makeHex((len-8),8) + "), on disk len is " + len );

    // print additional information for drawings and atoms
    if (optEscher && cname.equals("PPDrawing")) {
      DefaultEscherRecordFactory factory = new DefaultEscherRecordFactory();

      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      r.writeOut(baos);
      byte[] b = baos.toByteArray();

      EscherRecord er = factory.createRecord(b, 0);
      er.fillFields(b, 0, factory);
     
      System.out.println( printEscherRecord( er ) );
           
    } else if(optVerbose && r.getChildRecords() == null) {
      String recData = getPrintableRecordContents(r);
      System.out.println(ind + recData );
    }

    System.out.println();

    // If it has children, show them
    if(r.getChildRecords() != null) {
      walkTree((depth+3),pos+8,r.getChildRecords());
    }

    // Wind on the position marker
    pos += len;
  }
View Full Code Here


    byte[] s_slwt = writeRecord(s_SLWT);
   
    // Check the records are the same
    assertEquals(refSLWT.getChildRecords().length, s_SLWT.getChildRecords().length);
    for(int i=0; i<refSLWT.getChildRecords().length; i++) {
      Record ref_r = refSLWT.getChildRecords()[i];
      Record s_r = s_SLWT.getChildRecords()[i];
     
      byte[] r_rb = writeRecord(ref_r);
      byte[] s_rb = writeRecord(s_r);
      assertEquals(r_rb.length, s_rb.length);
      for(int j=0; j<r_rb.length; j++) {
View Full Code Here

  int indent = depth;
  String ind = "";
  for(int i=0; i<indent; i++) { ind += " "; }

  for(int i=0; i<records.length; i++) {
    Record r = records[i];

    // Figure out how big it is
    int len = getDiskLen(r);

    // Grab the type as hex
    String hexType = makeHex((int)r.getRecordType(),4);
    String rHexType = reverseHex(hexType);

    // Grab the hslf.record type
    Class c = r.getClass();
    String cname = c.toString();
    if(cname.startsWith("class ")) {
      cname = cname.substring(6);
    }
    if(cname.startsWith("org.apache.poi.hslf.record.")) {
      cname = cname.substring(27);
    }

    // Display the record
    System.out.println(ind + "At position " + pos + " (" + makeHex(pos,6) + "):");
    System.out.println(ind + " Record is of type " + cname);
    System.out.println(ind + " Type is " + r.getRecordType() + " (" + hexType + " -> " + rHexType + " )");
    System.out.println(ind + " Len is " + (len-8) + " (" + makeHex((len-8),8) + "), on disk len is " + len );
    System.out.println();

    // If it has children, show them
    if(r.getChildRecords() != null) {
      walkTree((depth+3),pos+8,r.getChildRecords());
    }

    // Wind on the position marker
    pos += len;
  }
View Full Code Here

    byte[] s_slwt = writeRecord(s_SLWT);
   
    // Check the records are the same
    assertEquals(refSLWT.getChildRecords().length, s_SLWT.getChildRecords().length);
    for(int i=0; i<refSLWT.getChildRecords().length; i++) {
      Record ref_r = refSLWT.getChildRecords()[i];
      Record s_r = s_SLWT.getChildRecords()[i];
     
      byte[] r_rb = writeRecord(ref_r);
      byte[] s_rb = writeRecord(s_r);
      assertEquals(r_rb.length, s_rb.length);
      for(int j=0; j<r_rb.length; j++) {
View Full Code Here

   
    // Use the TextHeader atom to get at the parent
    RecordContainer runAtomsParent = _headerAtom.getParentRecord();
   
    // Add the new StyleTextPropAtom after the TextCharsAtom / TextBytesAtom
    Record addAfter = _byteAtom;
    if(_byteAtom == null) { addAfter = _charAtom; }
    runAtomsParent.addChildAfter(_styleAtom, addAfter);
   
    // Feed this to our sole rich text run
    if(_rtRuns.length != 1) {
View Full Code Here

    byte[] s_slwt = writeRecord(s_SLWT);

    // Check the records are the same
    assertEquals(refSLWT.getChildRecords().length, s_SLWT.getChildRecords().length);
    for(int i=0; i<refSLWT.getChildRecords().length; i++) {
      Record ref_r = refSLWT.getChildRecords()[i];
      Record s_r = s_SLWT.getChildRecords()[i];

      byte[] r_rb = writeRecord(ref_r);
      byte[] s_rb = writeRecord(s_r);
      assertEquals(r_rb.length, s_rb.length);
      for(int j=0; j<r_rb.length; j++) {
View Full Code Here

TOP

Related Classes of org.apache.poi.hslf.record.Record

Copyright © 2018 www.massapicom. 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.