zhao
2021-07-02 081df17b8cc4a6e7e4f4e1e1887f24810e3ec2f9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using System;
using System.Collections.Generic;
using System.Text;
using HH.WMS.Utils.NPOI.Util;
 
 
namespace HH.WMS.Utils.NPOI.HSSF.Record
{
    public class FtCblsSubRecord : SubRecord
    {
        public const short sid = 0x0C;
        private const int ENCODED_SIZE = 20;
 
        private byte[] reserved;
 
        /**
         * Construct a new <code>FtCblsSubRecord</code> and
         * fill its data with the default values
         */
        public FtCblsSubRecord()
        {
            reserved = new byte[ENCODED_SIZE];
        }
 
        public FtCblsSubRecord(ILittleEndianInput in1, int size)
        {
            if (size != ENCODED_SIZE)
            {
                throw new RecordFormatException("Unexpected size (" + size + ")");
            }
            //just grab the raw data
            byte[] buf = new byte[size];
            in1.ReadFully(buf);
            reserved = buf;
        }
 
        /**
         * Convert this record to string.
         * Used by BiffViewer and other utilities.
         */
        public override String ToString()
        {
            StringBuilder buffer = new StringBuilder();
 
            buffer.Append("[FtCbls ]").Append("\n");
            buffer.Append("  size     = ").Append(DataSize).Append("\n");
            buffer.Append("  reserved = ").Append(HexDump.ToHex(reserved)).Append("\n");
            buffer.Append("[/FtCbls ]").Append("\n");
            return buffer.ToString();
        }
 
        /**
         * Serialize the record data into the supplied array of bytes
         *
         * @param out the stream to serialize into
         */
        public override void Serialize(ILittleEndianOutput out1)
        {
            out1.WriteShort(sid);
            out1.WriteShort(reserved.Length);
            out1.Write(reserved);
        }
 
        public override int DataSize
        {
            get
            {
                return reserved.Length;
            }
        }
 
        /**
         * @return id of this record.
         */
        public override short Sid
        {
            get
            {
                return sid;
            }
        }
 
        public override Object Clone()
        {
            FtCblsSubRecord rec = new FtCblsSubRecord();
            byte[] recdata = new byte[reserved.Length];
            Array.Copy(reserved, 0, recdata, 0, recdata.Length);
            rec.reserved = recdata;
            return rec;
        }
 
    }
}