Exemple #1
0
        /**
         * Constructor
         *
         * @param dg the escher stream data
         * @param p the current position in the stream
         */
        public EscherRecordData(EscherStream dg, int p)
        {
            escherStream = dg;
            pos          = p;
            byte[] data = escherStream.getData();

            streamLength = data.Length;

            // First two bytes contain instance and version
            int value = IntegerHelper.getInt(data[pos], data[pos + 1]);

            // Instance value is the first 12 bits
            instance = (value & 0xfff0) >> 4;

            // Version is the last four bits
            version = value & 0xf;

            // Bytes 2 and 3 are the record id
            recordId = IntegerHelper.getInt(data[pos + 2], data[pos + 3]);

            // Length is bytes 4,5,6 and 7
            length = IntegerHelper.getInt(data[pos + 4], data[pos + 5],
                                          data[pos + 6], data[pos + 7]);

            if (version == 0x0f)
            {
                container = true;
            }
            else
            {
                container = false;
            }
        }
        /**
         * Constructor
         *
         * @param dg the escher stream data
         * @param p the current position in the stream
         */
        public EscherRecordData(EscherStream dg,int p)
        {
            escherStream = dg;
            pos = p;
            byte[] data = escherStream.getData();

            streamLength = data.Length;

            // First two bytes contain instance and version
            int value = IntegerHelper.getInt(data[pos],data[pos + 1]);

            // Instance value is the first 12 bits
            instance = (value & 0xfff0) >> 4;

            // Version is the last four bits
            version = value & 0xf;

            // Bytes 2 and 3 are the record id
            recordId = IntegerHelper.getInt(data[pos + 2],data[pos + 3]);

            // Length is bytes 4,5,6 and 7
            length = IntegerHelper.getInt(data[pos + 4],data[pos + 5],
                                          data[pos + 6],data[pos + 7]);

            if (version == 0x0f)
                {
                container = true;
                }
            else
                {
                container = false;
                }
        }
Exemple #3
0
 /**
  * Constructor
  *
  * @param s the stream
  * @param bw the writer
  */
 public EscherDisplay(EscherStream s, TextWriter os)
 {
     stream = s;
     writer = os;
 }