Example #1
0
 public void ToDelta(DataOutput output)
 {
     lock (LOCK_THIS_CLASS)
     {
         toDeltaCounter++;
     }
     output.WriteSByte(deltaBits);
     if (deltaBits != 0)
     {
         if ((deltaBits & INT_MASK) == INT_MASK)
         {
             output.WriteInt32(intVar);
         }
         if ((deltaBits & STR_MASK) == STR_MASK)
         {
             output.WriteObject(str);
         }
         if ((deltaBits & DOUBLE_MASK) == DOUBLE_MASK)
         {
             output.WriteDouble(doubleVar);
         }
         if ((deltaBits & BYTE_ARR_MASK) == BYTE_ARR_MASK)
         {
             output.WriteObject(byteArr);
         }
         if ((deltaBits & TEST_OBJ_MASK) == TEST_OBJ_MASK)
         {
             output.WriteObject(testobj);
         }
     }
 }
Example #2
0
 public void ToData(DataOutput output)
 {
     output.WriteInt32(ProductID);
     output.WriteUTF(Name);
     output.WriteUTF(ProductNumber);
     output.WriteUTF(MakeFlag);
     output.WriteUTF(FinishedGoodsFlag);
     output.WriteUTF(Color);
     output.WriteInt32(SafetyStockLevel);
     output.WriteInt32(ReorderPoint);
     output.WriteDouble(StandardCost);
     output.WriteDouble(ListPrice);
     output.WriteInt32(DaysToManufacture);
     output.WriteUTF(SellStartDate);
     output.WriteUTF(DiscontinuedDate);
 }
Example #3
0
 public void ToDelta(DataOutput output)
 {
     output.WriteDouble(netWorth);
     if (encodeTimestamp)
     {
         output.WriteInt64(timestamp);
     }
 }
Example #4
0
 public override void ToData(DataOutput output)
 {
     output.WriteInt32(acctId);
     output.WriteObject(customerName);
     output.WriteDouble(netWorth);
     output.WriteDictionary((IDictionary)assets); // rjk currently not work as WriteDictionary API is not generic
     output.WriteInt64(timestamp);
 }
Example #5
0
 /// <summary>
 ///     NOTE: Code-generation-invoked method, method name and parameter order matters
 /// </summary>
 /// <param name="output">out</param>
 /// <param name="vector">points</param>
 /// <throws>IOException io error</throws>
 public static void WritePoints(
     DataOutput output,
     SortedDoubleVector vector)
 {
     output.WriteInt(vector.Values.Count);
     foreach (var num in vector.Values) {
         output.WriteDouble(num);
     }
 }
Example #6
0
        public void Write(double? @object, DataOutput stream)
        {
            bool isNull = @object == null;

            stream.WriteBoolean(isNull);
            if (!isNull)
            {
                stream.WriteDouble(@object.Value);
            }
        }
Example #7
0
 public void ToData(DataOutput output)
 {
     output.WriteInt64(m_avg20DaysVol);
     output.WriteUTF(m_bondRating);
     output.WriteDouble(m_convRatio);
     output.WriteUTF(m_country);
     output.WriteDouble(m_delta);
     output.WriteInt64(m_industry);
     output.WriteInt64(m_issuer);
     output.WriteDouble(m_mktValue);
     output.WriteDouble(m_qty);
     output.WriteUTF(m_secId);
     output.WriteUTF(m_secLinks);
     output.WriteUTF(m_secType);
     output.WriteInt32(m_sharesOutstanding);
     output.WriteUTF(m_underlyer);
     output.WriteInt64(m_volatility);
     output.WriteInt32(m_pid);
 }
Example #8
0
 public void ToData(DataOutput output)
 {
     output.WriteInt32(intVar);
     output.WriteObject(str);
     output.WriteDouble(doubleVar);
     output.WriteObject(byteArr);
     output.WriteObject(testobj);
     lock (LOCK_THIS_CLASS)
     {
         toDataCount++;
     }
 }
Example #9
0
 /// <summary>
 ///     NOTE: Code-generation-invoked method, method name and parameter order matters
 /// </summary>
 /// <param name="output">output</param>
 /// <param name="valueSet">values</param>
 /// <throws>IOException io error</throws>
 public static void WritePoints(
     DataOutput output,
     RefCountedSet<double> valueSet)
 {
     var refSet = valueSet.RefSet;
     output.WriteInt(refSet.Count);
     output.WriteInt(valueSet.NumValues);
     foreach (var entry in valueSet.RefSet) {
         output.WriteDouble(entry.Key);
         output.WriteInt(entry.Value);
     }
 }
 private void WriteArray(double[] array, DataOutput output)
 {
     if (array == null)
     {
         output.WriteInt(-1);
         return;
     }
     output.WriteInt(array.Length);
     foreach (double i in array)
     {
         output.WriteDouble(i);
     }
 }
Example #11
0
        public override void ToData(DataOutput output)
        {
            output.WriteUTF(state);
            output.WriteUTF(demandInd);
            output.WriteUTF(side);
            output.WriteUTF(ordType);
            output.WriteUTF(senderCompID);
            output.WriteUTF(tarCompID);
            output.WriteUTF(tarSubID);
            output.WriteUTF(handlInst);
            output.WriteUTF(orderID);
            output.WriteUTF(timeInForce);
            output.WriteUTF(clOrdID);
            output.WriteUTF(orderCapacity);
            output.WriteUTF(symbol);
            output.WriteUTF(symbolSfx);
            output.WriteUTF(execInst);
            output.WriteUTF(oldClOrdID);
            output.WriteUTF(discretionInst);
            output.WriteUTF(financeInd);
            output.WriteUTF(securityID);
            output.WriteUTF(targetCompID);
            output.WriteUTF(targetSubID);
            output.WriteUTF(clientAvailabilityKey);
            output.WriteUTF(var1);
            output.WriteUTF(var2);
            output.WriteUTF(var3);
            output.WriteUTF(var4);
            output.WriteUTF(var5);
            output.WriteUTF(var6);
            output.WriteUTF(var7);
            output.WriteUTF(var8);
            output.WriteUTF(var9);

            //ints
            output.WriteInt32(myIndex);
            output.WriteInt32(cxlQty);
            output.WriteInt32(isSyntheticOrder);
            output.WriteInt32(isRestricted);
            output.WriteInt32(orderQty);
            output.WriteInt32(cumQty);
            output.WriteInt32(isDoneForDay);
            output.WriteInt32(revisionSeqNum);
            output.WriteInt32(replaceQty);
            output.WriteInt32(isIrregularSettlmnt);

            //longs
            output.WriteInt64(timestamp);
            output.WriteInt64(availQty);
            output.WriteInt64(usedClientAvailability);

            //doubles
            output.WriteDouble(executedPriceSum);
            output.WriteDouble(positionQty);
            output.WriteDouble(price);
            output.WriteDouble(stopPx);
            output.WriteDouble(pegDifference);
            output.WriteDouble(discretionOffset);
        }
Example #12
0
 private void WriteInternal(double[] @object, DataOutput output)
 {
     if (@object == null)
     {
         output.WriteInt(-1);
         return;
     }
     output.WriteInt(@object.Length);
     foreach (double i in @object)
     {
         output.WriteDouble(i);
     }
 }
Example #13
0
        /// <summary>Write sigma to DataOutput</summary>
        /// <exception cref="System.IO.IOException"/>
        public static void Write(Summation sigma, DataOutput @out)
        {
            SummationWritable.ArithmeticProgressionWritable.Write(sigma.N, @out);
            SummationWritable.ArithmeticProgressionWritable.Write(sigma.E, @out);
            double v = sigma.GetValue();

            if (v == null)
            {
                @out.WriteBoolean(false);
            }
            else
            {
                @out.WriteBoolean(true);
                @out.WriteDouble(v);
            }
        }
Example #14
0
        public void ToData(DataOutput output)
        {
            output.WriteDouble(double_field);
            output.WriteFloat(float_field);
            output.WriteInt64(long_field);
            output.WriteInt32(int_field);
            output.WriteInt16(short_field);
            output.WriteUTF(string_field);
            int itemCount = string_vector.Count;

            output.WriteInt32(itemCount);
            for (int idx = 0; idx < itemCount; idx++)
            {
                string s = (string)string_vector[idx];
                output.WriteUTF(s);
            }
        }
Example #15
0
 public static void WriteValue(
     object value,
     DataOutput output)
 {
     if (value == null)
     {
         output.WriteByte(NULL_TYPE);
     }
     else if (value is int intValue)
     {
         output.WriteByte(INT_TYPE);
         output.WriteInt(intValue);
     }
     else if (value is double doubleValue)
     {
         output.WriteByte(DOUBLE_TYPE);
         output.WriteDouble(doubleValue);
     }
     else if (value is string stringValue)
     {
         output.WriteByte(STRING_TYPE);
         output.WriteUTF(stringValue);
     }
     else if (value is bool boolValue)
     {
         output.WriteByte(BOOLEAN_TYPE);
         output.WriteBoolean(boolValue);
     }
     else if (value is IDictionary <string, object> dictionary)
     {
         output.WriteByte(OBJECT_TYPE);
         Write(dictionary, output);
     }
     else if (value is object[] objectArray)
     {
         output.WriteByte(ARRAY_TYPE);
         WriteArray(objectArray, output);
     }
     else
     {
         throw new IOException("Unrecognized json object type value of type " + value.GetType() + "'");
     }
 }
Example #16
0
        public void Double()
        {
            List <Dictionary <string, string> > testdoubles = settings.GetValues(MethodBase.GetCurrentMethod(), "double");

            if (testdoubles != null)
            {
                foreach (Dictionary <string, string> dEntry in testdoubles)
                {
                    DataOutput dataOutput = new DataOutput();
                    double     testdouble = double.Parse(dEntry["value"]);
                    dataOutput.WriteDouble(testdouble);
                    byte[] buffer        = dataOutput.GetBuffer();
                    byte[] expectedBytes = Util.String2Bytes(dEntry["bytes"]);
                    Util.CompareTestArrays(expectedBytes, buffer);

                    DataInput dataInput = new DataInput(buffer);
                    double    result    = dataInput.ReadDouble();
                    Assert.AreEqual(testdouble, result);
                }
            }
        }
Example #17
0
 public void Write(double @object, DataOutput stream)
 {
     stream.WriteDouble(@object);
 }
Example #18
0
 public override void Write(double @object, DataOutput output, byte[] pageFullKey, EventBeanCollatedWriter writer)
 {
     output.WriteDouble(@object);
 }
Example #19
0
 public override void ToData(DataOutput output)
 {
     output.WriteInt32(assetId);
     output.WriteDouble(value);
 }