Package org.apache.poi.hdgf.pointers

Examples of org.apache.poi.hdgf.pointers.Pointer


    }
    String ind2 = ind  + "    ";
    String ind3 = ind2 + "    ";
   
   
    Pointer ptr = stream.getPointer();
    System.out.println(ind + "Stream at\t" + ptr.getOffset() +
        " - " + Integer.toHexString(ptr.getOffset()));
    System.out.println(ind + "  Type is\t" + ptr.getType() +
        " - " + Integer.toHexString(ptr.getType()));
    System.out.println(ind + "  Format is\t" + ptr.getFormat() +
        " - " + Integer.toHexString(ptr.getFormat()));
    System.out.println(ind + "  Length is\t" + ptr.getLength() +
        " - " + Integer.toHexString(ptr.getLength()));
    if(ptr.destinationCompressed()) {
      int decompLen = stream._getContentsLength();
      System.out.println(ind + "  DC.Length is\t" + decompLen +
          " - " + Integer.toHexString(decompLen));
    }
    System.out.println(ind + "  Compressed is\t" + ptr.destinationCompressed());
    System.out.println(ind + "  Stream is\t" + stream.getClass().getName());
   
    byte[] db = stream._getStore()._getContents();
    String ds = "";
    if(db.length >= 8) {
View Full Code Here


    System.err.println("Trailer has length " + trailerPointer.getLength());
    System.err.println("Trailer has format " + trailerPointer.getFormat());
   
    for(int i=0; i<trailer.getPointedToStreams().length; i++) {
      Stream stream = trailer.getPointedToStreams()[i];
      Pointer ptr = stream.getPointer();
     
      System.err.println("Looking at pointer " + i);
      System.err.println("\tType is " + ptr.getType() + "\t\t" + Integer.toHexString(ptr.getType()));
      System.err.println("\tOffset is " + ptr.getOffset() + "\t\t" + Long.toHexString(ptr.getOffset()));
      System.err.println("\tAddress is " + ptr.getAddress() + "\t" + Long.toHexString(ptr.getAddress()));
      System.err.println("\tLength is " + ptr.getLength() + "\t\t" + Long.toHexString(ptr.getLength()));
      System.err.println("\tFormat is " + ptr.getFormat() + "\t\t" + Long.toHexString(ptr.getFormat()));
      System.err.println("\tCompressed is " + ptr.destinationCompressed());
      System.err.println("\tStream is " + stream.getClass());
     
      if(stream instanceof PointerContainingStream) {
        PointerContainingStream pcs = (PointerContainingStream)stream;
       
        if(pcs.getPointedToStreams() != null && pcs.getPointedToStreams().length > 0) {
          System.err.println("\tContains " + pcs.getPointedToStreams().length + " other pointers/streams");
          for(int j=0; j<pcs.getPointedToStreams().length; j++) {
            Stream ss = pcs.getPointedToStreams()[j];
            Pointer sptr = ss.getPointer();
            System.err.println("\t\t" + j + " - Type is " + sptr.getType() + "\t\t" + Integer.toHexString(sptr.getType()));
            System.err.println("\t\t" + j + " - Length is " + sptr.getLength() + "\t\t" + Long.toHexString(sptr.getLength()));
          }
        }
      }
     
      if(stream instanceof StringsStream) {
View Full Code Here

    System.err.println("Trailer has length " + trailerPointer.getLength());
    System.err.println("Trailer has format " + trailerPointer.getFormat());

    for(int i=0; i<trailer.getPointedToStreams().length; i++) {
      Stream stream = trailer.getPointedToStreams()[i];
      Pointer ptr = stream.getPointer();

      System.err.println("Looking at pointer " + i);
      System.err.println("\tType is " + ptr.getType() + "\t\t" + Integer.toHexString(ptr.getType()));
      System.err.println("\tOffset is " + ptr.getOffset() + "\t\t" + Long.toHexString(ptr.getOffset()));
      System.err.println("\tAddress is " + ptr.getAddress() + "\t" + Long.toHexString(ptr.getAddress()));
      System.err.println("\tLength is " + ptr.getLength() + "\t\t" + Long.toHexString(ptr.getLength()));
      System.err.println("\tFormat is " + ptr.getFormat() + "\t\t" + Long.toHexString(ptr.getFormat()));
      System.err.println("\tCompressed is " + ptr.destinationCompressed());
      System.err.println("\tStream is " + stream.getClass());

      if(stream instanceof PointerContainingStream) {
        PointerContainingStream pcs = (PointerContainingStream)stream;

        if(pcs.getPointedToStreams() != null && pcs.getPointedToStreams().length > 0) {
          System.err.println("\tContains " + pcs.getPointedToStreams().length + " other pointers/streams");
          for(int j=0; j<pcs.getPointedToStreams().length; j++) {
            Stream ss = pcs.getPointedToStreams()[j];
            Pointer sptr = ss.getPointer();
            System.err.println("\t\t" + j + " - Type is " + sptr.getType() + "\t\t" + Integer.toHexString(sptr.getType()));
            System.err.println("\t\t" + j + " - Length is " + sptr.getLength() + "\t\t" + Long.toHexString(sptr.getLength()));
          }
        }
      }

      if(stream instanceof StringsStream) {
View Full Code Here

    System.err.println("Trailer has length " + trailerPointer.getLength());
    System.err.println("Trailer has format " + trailerPointer.getFormat());
   
    for(int i=0; i<trailer.getPointedToStreams().length; i++) {
      Stream stream = trailer.getPointedToStreams()[i];
      Pointer ptr = stream.getPointer();
     
      System.err.println("Looking at pointer " + i);
      System.err.println("\tType is " + ptr.getType() + "\t\t" + Integer.toHexString(ptr.getType()));
      System.err.println("\tOffset is " + ptr.getOffset() + "\t\t" + Long.toHexString(ptr.getOffset()));
      System.err.println("\tAddress is " + ptr.getAddress() + "\t" + Long.toHexString(ptr.getAddress()));
      System.err.println("\tLength is " + ptr.getLength() + "\t\t" + Long.toHexString(ptr.getLength()));
      System.err.println("\tFormat is " + ptr.getFormat() + "\t\t" + Long.toHexString(ptr.getFormat()));
      System.err.println("\tCompressed is " + ptr.destinationCompressed());
      System.err.println("\tStream is " + stream.getClass());
     
      if(stream instanceof PointerContainingStream) {
        PointerContainingStream pcs = (PointerContainingStream)stream;
       
        if(pcs.getPointedToStreams() != null && pcs.getPointedToStreams().length > 0) {
          System.err.println("\tContains " + pcs.getPointedToStreams().length + " other pointers/streams");
          for(int j=0; j<pcs.getPointedToStreams().length; j++) {
            Stream ss = pcs.getPointedToStreams()[j];
            Pointer sptr = ss.getPointer();
            System.err.println("\t\t" + j + " - Type is " + sptr.getType() + "\t\t" + Integer.toHexString(sptr.getType()));
            System.err.println("\t\t" + j + " - Length is " + sptr.getLength() + "\t\t" + Long.toHexString(sptr.getLength()));
          }
        }
      }
     
      if(stream instanceof StringsStream) {
View Full Code Here

    System.err.println("Trailer has length " + trailerPointer.getLength());
    System.err.println("Trailer has format " + trailerPointer.getFormat());
   
    for(int i=0; i<trailer.getPointedToStreams().length; i++) {
      Stream stream = trailer.getPointedToStreams()[i];
      Pointer ptr = stream.getPointer();
     
      System.err.println("Looking at pointer " + i);
      System.err.println("\tType is " + ptr.getType() + "\t\t" + Integer.toHexString(ptr.getType()));
      System.err.println("\tOffset is " + ptr.getOffset() + "\t\t" + Long.toHexString(ptr.getOffset()));
      System.err.println("\tAddress is " + ptr.getAddress() + "\t" + Long.toHexString(ptr.getAddress()));
      System.err.println("\tLength is " + ptr.getLength() + "\t\t" + Long.toHexString(ptr.getLength()));
      System.err.println("\tFormat is " + ptr.getFormat() + "\t\t" + Long.toHexString(ptr.getFormat()));
      System.err.println("\tCompressed is " + ptr.destinationCompressed());
      System.err.println("\tStream is " + stream.getClass());
     
      if(stream instanceof PointerContainingStream) {
        PointerContainingStream pcs = (PointerContainingStream)stream;
       
        if(pcs.getPointedToStreams() != null && pcs.getPointedToStreams().length > 0) {
          System.err.println("\tContains " + pcs.getPointedToStreams().length + " other pointers/streams");
          for(int j=0; j<pcs.getPointedToStreams().length; j++) {
            Stream ss = pcs.getPointedToStreams()[j];
            Pointer sptr = ss.getPointer();
            System.err.println("\t\t" + j + " - Type is " + sptr.getType() + "\t\t" + Integer.toHexString(sptr.getType()));
            System.err.println("\t\t" + j + " - Length is " + sptr.getLength() + "\t\t" + Long.toHexString(sptr.getLength()));
          }
        }
      }
     
      if(stream instanceof StringsStream) {
View Full Code Here

    contents = new byte[docProps.getSize()];
    filesystem.createDocumentInputStream("VisioDocument").read(contents);
  }

  public void testGetTrailer() {
    Pointer trailerPointer = ptrFactory.createPointer(contents, 0x24);
    Stream.createStream(trailerPointer, contents, chunkFactory, ptrFactory);
  }
View Full Code Here

    int offsetA = 3708;
    int offsetB = 3744;
  }

  public void testGetChildren() {
    Pointer trailerPointer = ptrFactory.createPointer(contents, 0x24);
    TrailerStream trailer = (TrailerStream)
      Stream.createStream(trailerPointer, contents, chunkFactory, ptrFactory);

    // Get without recursing
    Pointer[] ptrs = trailer.getChildPointers();
View Full Code Here

  /**
   * Test creating the trailer, but not looking for children
   */
  public void testTrailer() {
    // Find the trailer
    Pointer trailerPtr = ptrFactory.createPointer(contents, trailerPointerAt);

    assertEquals(20, trailerPtr.getType());
    assertEquals(trailerDataAt, trailerPtr.getOffset());

    Stream stream = Stream.createStream(trailerPtr, contents, chunkFactory, ptrFactory);
    assertTrue(stream instanceof TrailerStream);
    TrailerStream ts = (TrailerStream)stream;

View Full Code Here

    assertEquals(0x17, ts.getChildPointers()[2].getType());
    assertEquals(0xff, ts.getChildPointers()[3].getType());
  }

  public void testChunks() {
    Pointer trailerPtr = ptrFactory.createPointer(contents, trailerPointerAt);
    TrailerStream ts = (TrailerStream)
      Stream.createStream(trailerPtr, contents, chunkFactory, ptrFactory);

    // Should be 7th one
    Pointer chunkPtr = ts.getChildPointers()[5];
    assertFalse(chunkPtr.destinationHasStrings());
    assertTrue(chunkPtr.destinationHasChunks());
    assertFalse(chunkPtr.destinationHasPointers());

    Stream stream = Stream.createStream(chunkPtr, contents, chunkFactory, ptrFactory);
    assertNotNull(stream);
    assertTrue(stream instanceof ChunkStream);
View Full Code Here

    ChunkStream cs = (ChunkStream)stream;
    cs.findChunks();
  }

  public void testStrings() {
    Pointer trailerPtr = ptrFactory.createPointer(contents, trailerPointerAt);
    TrailerStream ts = (TrailerStream)
      Stream.createStream(trailerPtr, contents, chunkFactory, ptrFactory);

    // Should be the 1st one
    Pointer stringPtr = ts.getChildPointers()[0];
    assertTrue(stringPtr.destinationHasStrings());
    assertFalse(stringPtr.destinationHasChunks());
    assertFalse(stringPtr.destinationHasPointers());

    Stream stream = Stream.createStream(stringPtr, contents, chunkFactory, ptrFactory);
    assertNotNull(stream);
    assertTrue(stream instanceof StringsStream);
  }
View Full Code Here

TOP

Related Classes of org.apache.poi.hdgf.pointers.Pointer

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.