Exemple #1
0
        private void writeInt128()
        {
            DataWriter        dw  = initPofWriter("Int128");
            WritingPofHandler wfh = new WritingPofHandler(dw);
            PofStreamWriter   psw = new PofStreamWriter(wfh, new SimplePofContext());

            // Test data:
            //   First byte array is equivalent to BigInteger.TEN
            byte[] b1 = { 0x0a };

            //   Second byte array is equivalent to BigInteger("55 5555 5555 5555 5555")
            //   (spaces are there for human parsing).
            //   Equivalent to hex: 0x 07 b5 ba d5 95 e2 38 e3
            byte[] b2 = { 0x07, 0xb5, 0xba, 0xd5, 0x95, 0xe2, 0x38, 0xe3 };

            RawInt128 rawInt1 = new RawInt128(b1);
            RawInt128 rawInt2 = new RawInt128(b2);

            psw.WriteRawInt128(0, rawInt1);
            psw.WriteRawInt128(0, rawInt2);

            dw.Flush();
            dw.Close();
        }