Exemple #1
0
        public void writeCompressed(ExtendedDataOutput output)
        {
            short flag = ((short)(DATA_FORM.DF_TABLE) << 8 | 8 & 0xff); //8: table type TODO: add table type

            output.writeShort(flag);

            int rows = this.rows();
            int cols = this.columns();

            output.writeInt(rows);
            output.writeInt(cols);
            output.writeString("");     //table name
            for (int i = 0; i < cols; i++)
            {
                output.writeString(this.getColumnName(i));
            }

            for (int i = 0; i < cols; i++)
            {
                AbstractVector v = (AbstractVector)this.getColumn(i);
                if (v.getDataType() == DATA_TYPE.DT_SYMBOL)
                {
                    v.write((ExtendedDataOutput)output);
                }
                else
                {
                    v.writeCompressed((ExtendedDataOutput)output);
                }
                output.flush();
            }
        }
 protected internal override void writeVectorToOutputStream(ExtendedDataOutput @out)
 {
     foreach (string str in values)
     {
         @out.writeString(str);
     }
 }
 public override void serialize(int start, int count, ExtendedDataOutput @out)
 {
     for (int i = 0; i < count; ++i)
     {
         @out.writeString(values[start + i]);
     }
 }
Exemple #4
0
        public virtual void write(ExtendedDataOutput @out)
        {
            int flag = ((int)DATA_FORM.DF_TABLE << 8) + (int)getDataType();

            @out.writeShort(flag);
            @out.writeInt(rows());
            @out.writeInt(columns());
            @out.writeString(""); //table name
            foreach (string colName in names_)
            {
                @out.writeString(colName);
            }
            foreach (IVector vector in columns_)
            {
                vector.write(@out);
            }
        }
Exemple #5
0
 //2021.01.19 cwj override?
 protected void writeScalarToOutputStream(ExtendedDataOutput @out, bool blob)
 {
     if (blob)
     {
         @out.writeBlob(value);
     }
     else
     {
         @out.writeString(value);
     }
 }
Exemple #6
0
        public virtual void write(ExtendedDataOutput @out)
        {
            int count = syms.Count;

            @out.writeInt(0);
            @out.writeInt(count);
            for (int i = 0; i < count; ++i)
            {
                @out.writeString(syms[i]);
            }
        }
Exemple #7
0
        public virtual void write(ExtendedDataOutput output)
        {
            int length = 27 + AbstractExtendedDataOutputStream.getUTFlength(path, 0, 0) + sites.Count;

            foreach (string site in sites)
            {
                length += AbstractExtendedDataOutputStream.getUTFlength(site, 0, 0);
            }
            output.writeShort(length);
            output.writeString(path);
            output.write(id);
            output.writeInt(version);
            output.writeInt(size_Renamed);
            output.writeByte(flag);
            output.writeByte(sites.Count);
            foreach (string site in sites)
            {
                output.writeUTF(site);
            }
        }
Exemple #8
0
        public virtual void write(ExtendedDataOutput @out, SymbolBase @base)
        {
            bool existing = false;
            int  id       = 0;

            if (existingBases == null)
            {
                existingBases        = new Dictionary <SymbolBase, int>();
                existingBases[@base] = 0;
            }
            else
            {
                int?curId = existingBases[@base];
                if (curId != null)
                {
                    existing = true;
                    id       = curId.Value;
                }
                else
                {
                    id = existingBases.Count;
                    existingBases[@base] = id;
                }
            }
            @out.writeInt(id);
            if (existing)
            {
                @out.writeInt(0);
            }
            else
            {
                int size = @base.size();
                @out.writeInt(size);
                for (int i = 0; i < size; ++i)
                {
                    @out.writeString(@base.getSymbol(i));
                }
            }
        }
Exemple #9
0
 protected override void writeScalarToOutputStream(ExtendedDataOutput @out)
 {
     @out.writeString(value);
 }