Package org.apache.poi.util

Examples of org.apache.poi.util.LittleEndianInputStream


                                 "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


    if (in instanceof LittleEndianInput) {
      // accessing directly is an optimisation
      _le = (LittleEndianInput) in;
    } else {
      // less optimal, but should work OK just the same. Often occurs in junit tests.
      _le = new LittleEndianInputStream(in);
    }
    _nextSid = readNextSid();
  }
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

             0x79, 0x79, 0x11, 0x11,
             0x22, 0x22, 0x33, 0x33,
       };
       assertEquals(8, data.length);
      
       LittleEndianInputStream inp = new LittleEndianInputStream(
             new ByteArrayInputStream(data)
       );
       ExtRst ext = new ExtRst(inp, data.length);
      
       // Will be empty
View Full Code Here

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

    }
        */

    subrecords = new ArrayList<SubRecord>();
    ByteArrayInputStream bais = new ByteArrayInputStream(subRecordData);
    LittleEndianInputStream subRecStream = new LittleEndianInputStream(bais);
    CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord)SubRecord.createSubRecord(subRecStream, 0);
        subrecords.add(cmo);
        while (true) {
      SubRecord subRecord = SubRecord.createSubRecord(subRecStream, cmo.getObjectType());
      subrecords.add(subRecord);
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));
        try {
            LbsDataSubRecord.LbsDropData lbs = new LbsDataSubRecord.LbsDropData(in);
   
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            LittleEndianOutputStream out = new LittleEndianOutputStream(baos);
            try {
                lbs.serialize(out);
       
                assertArrayEquals(data, baos.toByteArray());
            } finally {
                out.close();
            }
        } finally {
            in.close();
        }
    }
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.