예제 #1
0
        public FtrHeader(RecordInputStream in1)
        {
            recordType = in1.ReadShort();
            grbitFrt = in1.ReadShort();

            reserved = new byte[8];
            in1.Read(reserved, 0, 8);
        }
예제 #2
0
 public OldSheetRecord(RecordInputStream in1)
 {
     field_1_position_of_BOF = in1.ReadInt();
     field_2_visibility = in1.ReadUByte();
     field_3_type = in1.ReadUByte();
     int field_4_sheetname_length = in1.ReadUByte();
     field_5_sheetname = new byte[field_4_sheetname_length];
     in1.Read(field_5_sheetname, 0, field_4_sheetname_length);
 }
예제 #3
0
        public OldSheetRecord(RecordInputStream in1)
        {
            field_1_position_of_BOF = in1.ReadInt();
            field_2_visibility      = in1.ReadUByte();
            field_3_type            = in1.ReadUByte();
            int field_4_sheetname_length = in1.ReadUByte();

            field_5_sheetname = new byte[field_4_sheetname_length];
            in1.Read(field_5_sheetname, 0, field_4_sheetname_length);
        }
예제 #4
0
        /**
         * @param in the RecordInputstream to read the record from
         */
        public OldStringRecord(RecordInputStream in1)
        {
            sid = in1.Sid;

            if (in1.Sid == biff2_sid)
            {
                field_1_string_len = (short)in1.ReadUByte();
            }
            else
            {
                field_1_string_len = in1.ReadShort();
            }

            // Can only decode properly later when you know the codepage
            field_2_bytes = new byte[field_1_string_len];
            in1.Read(field_2_bytes, 0, field_1_string_len);
        }
예제 #5
0
        /**
         * @param in the RecordInputstream to read the record from
         */
        public OldStringRecord(RecordInputStream in1)
        {
            sid = in1.Sid;

            if (in1.Sid == biff2_sid)
            {
                field_1_string_len = (short)in1.ReadUByte();
            }
            else
            {
                field_1_string_len = in1.ReadShort();
            }

            // Can only decode properly later when you know the codepage
            field_2_bytes = new byte[field_1_string_len];
            in1.Read(field_2_bytes, 0, field_1_string_len);
        }
예제 #6
0
        /**
         * @param in the RecordInputstream to read the record from
         */
        public OldLabelRecord(RecordInputStream in1)
            : base(in1, in1.Sid == biff2_sid)
        {
            if (IsBiff2)
            {
                field_4_string_len = (short)in1.ReadUByte();
            }
            else
            {
                field_4_string_len = in1.ReadShort();
            }

            // Can only decode properly later when you know the codepage
            field_5_bytes = new byte[field_4_string_len];
            in1.Read(field_5_bytes, 0, field_4_string_len);

            if (in1.Remaining > 0)
            {
                logger.Log(POILogger.INFO,
                        "LabelRecord data remains: " + in1.Remaining +
                        " : " + HexDump.ToHex(in1.ReadRemainder())
                        );
            }
        }
예제 #7
0
        /**
         * @param in the RecordInputstream to read the record from
         */
        public OldLabelRecord(RecordInputStream in1)
            : base(in1, in1.Sid == biff2_sid)
        {
            if (IsBiff2)
            {
                field_4_string_len = (short)in1.ReadUByte();
            }
            else
            {
                field_4_string_len = in1.ReadShort();
            }

            // Can only decode properly later when you know the codepage
            field_5_bytes = new byte[field_4_string_len];
            in1.Read(field_5_bytes, 0, field_4_string_len);

            if (in1.Remaining > 0)
            {
                logger.Log(POILogger.INFO,
                           "LabelRecord data remains: " + in1.Remaining +
                           " : " + HexDump.ToHex(in1.ReadRemainder())
                           );
            }
        }
예제 #8
0
        /**
         * Read hyperlink from input stream
         *
         * @param in the stream to Read from
         */
        public HyperlinkRecord(RecordInputStream in1)
        {
            try
            {
                rwFirst = in1.ReadShort();
                rwLast = in1.ReadUShort();
                colFirst = in1.ReadShort();
                colLast = in1.ReadShort();

                // 16-byte GUID
                guid = new byte[16];
                in1.Read(guid, 0, guid.Length);

                label_opts = in1.ReadInt();
                link_opts = in1.ReadInt();

                if ((link_opts & HLINK_LABEL) != 0)
                {
                    int label_len = in1.ReadInt();
                    label = in1.ReadUnicodeLEString(label_len);
                }

                if ((link_opts & HLINK_URL) != 0)
                {
                    moniker = new byte[16];
                    in1.Read(moniker, 0, moniker.Length);

                    if (Arrays.Equals(URL_MONIKER, moniker))
                    {
                        int len = in1.ReadInt();

                        address = in1.ReadUnicodeLEString( (len - URL_TAIL.Length)/2);  //minus the length of tail

                        tail = in1.ReadRemainder();
                    }
                    else if (Arrays.Equals(FILE_MONIKER, moniker))
                    {
                        file_opts = in1.ReadShort();

                        int len = in1.ReadInt();

                        byte[] path_bytes = new byte[len];
                        in1.Read(path_bytes, 0, path_bytes.Length);

                        address = Encoding.UTF8.GetString(path_bytes);

                        tail = in1.ReadRemainder();
                    }
                }
                else if ((link_opts & HLINK_PLACE) != 0)
                {
                    int len = in1.ReadInt();
                    address = in1.ReadUnicodeLEString(len);
                }
            }
            catch (IOException)
            {
                throw;
            }

        }