Package org.apache.poi.util

Examples of org.apache.poi.util.LittleEndianByteArrayOutputStream.writeShort()


        bos.writeShort(str.length());
        StringUtil.putUnicodeLE(str, bos);
        bos.writeShort(1);
        bos.writeShort(1);
        bos.writeShort(3);
        bos.writeShort(42);
       
        LittleEndianInput in = new LittleEndianByteArrayInputStream(buf, 0, bos.getWriteIndex());
        UnicodeString.ExtRst extRst1 = new UnicodeString.ExtRst(in, bos.getWriteIndex());
        in = new LittleEndianByteArrayInputStream(buf, 0, bos.getWriteIndex());
        UnicodeString.ExtRst extRst2 = new UnicodeString.ExtRst(in, bos.getWriteIndex());
View Full Code Here


        LittleEndianByteArrayOutputStream leos = new LittleEndianByteArrayOutputStream(buf, 0);
        EncryptionInfo info = builder.getInfo();

        // EncryptionVersionInfo (4 bytes): A Version structure (section 2.1.4), where
        // Version.vMajor MUST be 0x0004 and Version.vMinor MUST be 0x0004
        leos.writeShort(info.getVersionMajor());
        leos.writeShort(info.getVersionMinor());
        // Reserved (4 bytes): A value that MUST be 0x00000040
        leos.writeInt(0x40);
        leos.write(bos.toByteArray());
       
View Full Code Here

        EncryptionInfo info = builder.getInfo();

        // EncryptionVersionInfo (4 bytes): A Version structure (section 2.1.4), where
        // Version.vMajor MUST be 0x0004 and Version.vMinor MUST be 0x0004
        leos.writeShort(info.getVersionMajor());
        leos.writeShort(info.getVersionMinor());
        // Reserved (4 bytes): A value that MUST be 0x00000040
        leos.writeInt(0x40);
        leos.write(bos.toByteArray());
       
        dir.createDocument("EncryptionInfo", leos.getWriteIndex(), new POIFSWriterListener() {
View Full Code Here

  public int serialize(int offset, byte[] data) {
    int recSize = getRecordSize();
    int dataSize = recSize - 4;
    LittleEndianByteArrayOutputStream out = new LittleEndianByteArrayOutputStream(data, offset, recSize);

    out.writeShort(sid);
    out.writeShort(dataSize);

    if (_uninterpretedData == null) {

      for (int i = 0; i < subrecords.size(); i++) {
View Full Code Here

    int recSize = getRecordSize();
    int dataSize = recSize - 4;
    LittleEndianByteArrayOutputStream out = new LittleEndianByteArrayOutputStream(data, offset, recSize);

    out.writeShort(sid);
    out.writeShort(dataSize);

    if (_uninterpretedData == null) {

      for (int i = 0; i < subrecords.size(); i++) {
        SubRecord record = subrecords.get(i);
View Full Code Here

        LittleEndianByteArrayOutputStream leos = new LittleEndianByteArrayOutputStream(buf, 0);
        EncryptionInfo info = builder.getInfo();

        // EncryptionVersionInfo (4 bytes): A Version structure (section 2.1.4), where
        // Version.vMajor MUST be 0x0004 and Version.vMinor MUST be 0x0004
        leos.writeShort(info.getVersionMajor());
        leos.writeShort(info.getVersionMinor());
        // Reserved (4 bytes): A value that MUST be 0x00000040
        leos.writeInt(info.getEncryptionFlags());
        leos.write(bos.toByteArray());
       
View Full Code Here

        EncryptionInfo info = builder.getInfo();

        // EncryptionVersionInfo (4 bytes): A Version structure (section 2.1.4), where
        // Version.vMajor MUST be 0x0004 and Version.vMinor MUST be 0x0004
        leos.writeShort(info.getVersionMajor());
        leos.writeShort(info.getVersionMinor());
        // Reserved (4 bytes): A value that MUST be 0x00000040
        leos.writeInt(info.getEncryptionFlags());
        leos.write(bos.toByteArray());
       
        dir.createDocument("EncryptionInfo", leos.getWriteIndex(), new POIFSWriterListener() {
View Full Code Here

  @Override
  public final int serialize(int offset, byte[] data) {
    int dataSize = getDataSize();
    int recSize = 4 + dataSize;
    LittleEndianByteArrayOutputStream out = new LittleEndianByteArrayOutputStream(data, offset, recSize);
    out.writeShort(getSid());
    out.writeShort(dataSize);
    serialize(out);
    if (out.getWriteIndex() - offset != recSize) {
      throw new IllegalStateException("Error in serialization of (" + getClass().getName() + "): "
          + "Incorrect number of bytes written - expected "
View Full Code Here

  public final int serialize(int offset, byte[] data) {
    int dataSize = getDataSize();
    int recSize = 4 + dataSize;
    LittleEndianByteArrayOutputStream out = new LittleEndianByteArrayOutputStream(data, offset, recSize);
    out.writeShort(getSid());
    out.writeShort(dataSize);
    serialize(out);
    if (out.getWriteIndex() - offset != recSize) {
      throw new IllegalStateException("Error in serialization of (" + getClass().getName() + "): "
          + "Incorrect number of bytes written - expected "
          + recSize + " but got " + (out.getWriteIndex() - offset));
View Full Code Here

  public int serialize(int offset, byte[] data) {
    int recSize = getRecordSize();
    int dataSize = recSize - 4;
    LittleEndianByteArrayOutputStream out = new LittleEndianByteArrayOutputStream(data, offset, recSize);

    out.writeShort(sid);
    out.writeShort(dataSize);

    if (_uninterpretedData == null) {

      for (int i = 0; i < subrecords.size(); i++) {
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.