Package org.apache.poi.util

Examples of org.apache.poi.util.LittleEndianInputStream


    }
    field_6_unknown = readRawData(in, remaining);
  }

  private static Ptg readRefPtg(byte[] formulaRawBytes) {
    LittleEndianInput in = new LittleEndianInputStream(new ByteArrayInputStream(formulaRawBytes));
    byte ptgSid = in.readByte();
    switch(ptgSid) {
      case AreaPtg.sid:   return new AreaPtg(in);
      case Area3DPtg.sid: return new Area3DPtg(in);
      case RefPtg.sid:    return new RefPtg(in);
      case Ref3DPtg.sid:  return new Ref3DPtg(in);
View Full Code Here


    }
    field_6_unknown = readRawData(in, remaining);
  }

  private static Ptg readRefPtg(byte[] formulaRawBytes) {
    LittleEndianInput in = new LittleEndianInputStream(new ByteArrayInputStream(formulaRawBytes));
    byte ptgSid = in.readByte();
    switch(ptgSid) {
      case AreaPtg.sid:   return new AreaPtg(in);
      case Area3DPtg.sid: return new Area3DPtg(in);
      case RefPtg.sid:    return new RefPtg(in);
      case Ref3DPtg.sid:  return new Ref3DPtg(in);
View Full Code Here

//    System.out.println(HexDump.toHex(subRecordData));

    subrecords = new ArrayList<SubRecord>();
    ByteArrayInputStream bais = new ByteArrayInputStream(subRecordData);
    LittleEndianInputStream subRecStream = new LittleEndianInputStream(bais);
    while (true) {
      SubRecord subRecord = SubRecord.createSubRecord(subRecStream);
      subrecords.add(subRecord);
      if (subRecord instanceof EndSubRecord) {
        break;
View Full Code Here

    if (is instanceof LittleEndianInput) {
      // accessing directly is an optimisation
      return (LittleEndianInput) is;
    }
    // less optimal, but should work OK just the same. Often occurs in junit tests.
    return new LittleEndianInputStream(is);
  }
View Full Code Here

                                 "6C, 00, " + //the smallest width in pixels allowed for the dropdown window
                                 "00, 00, " //num chars
                                 "00, " +      //compression flag
                                 "00");        //padding byte

        LittleEndianInputStream in = new LittleEndianInputStream(new ByteArrayInputStream(data));

        LbsDataSubRecord.LbsDropData lbs = new LbsDataSubRecord.LbsDropData(in);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        lbs.serialize(new LittleEndianOutputStream(baos));
View Full Code Here

    }
    field_6_unknown = readRawData(in, remaining);
  }

  private static Ptg readRefPtg(byte[] formulaRawBytes) {
    LittleEndianInput in = new LittleEndianInputStream(new ByteArrayInputStream(formulaRawBytes));
    byte ptgSid = in.readByte();
    switch(ptgSid) {
      case AreaPtg.sid:   return new AreaPtg(in);
      case Area3DPtg.sid: return new Area3DPtg(in);
      case RefPtg.sid:  return new RefPtg(in);
      case Ref3DPtg.sid:  return new Ref3DPtg(in);
View Full Code Here

                                 "6C, 00, " + //the smallest width in pixels allowed for the dropdown window
                                 "00, 00, " //num chars
                                 "00, " +      //compression flag
                                 "00");        //padding byte

        LittleEndianInputStream in = new LittleEndianInputStream(new ByteArrayInputStream(data));

        LbsDataSubRecord.LbsDropData lbs = new LbsDataSubRecord.LbsDropData(in);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        lbs.serialize(new LittleEndianOutputStream(baos));
View Full Code Here

       assertEquals(4, b[0]);
       assertEquals(0, b[1]);
       assertEquals(0x5c, b[2]);
       assertEquals(0x01, b[3]);
      
       LittleEndianInputStream inp = new LittleEndianInputStream(
             new ByteArrayInputStream(b)
       );
       fr = new FormatRun(inp);
       assertEquals(4, fr.getCharacterPos());
       assertEquals(0x15c, fr.getFontIndex());
View Full Code Here

      
      
       // Load in again and re-test
       byte[] data = new byte[14];
       System.arraycopy(b, 4, data, 0, data.length);
       LittleEndianInputStream inp = new LittleEndianInputStream(
             new ByteArrayInputStream(data)
       );
       ext = new ExtRst(inp, data.length);
      
       assertEquals(0, ext.getNumberOfRuns());
View Full Code Here

             00, 00, 00, 00,
             00, 00 // Cruft at the end, as found from real files
       };
       assertEquals(16, data.length);
      
       LittleEndianInputStream inp = new LittleEndianInputStream(
             new ByteArrayInputStream(data)
       );
       ExtRst ext = new ExtRst(inp, data.length);
       assertEquals(0x0c, ext.getDataSize()); // Excludes 4 byte header
      
View Full Code Here

TOP

Related Classes of org.apache.poi.util.LittleEndianInputStream

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.