public override object Read(CompactBinaryReader reader)
 {
     int length = reader.ReadInt32();
     byte[] stream = new byte[length];
     stream = reader.ReadBytes(length);
     return UTF8Encoding.UTF8.GetString(stream);
     //return reader.ReadString();
 }
        public override object Read(CompactBinaryReader reader)
        {
            int length = reader.ReadInt32();

            byte[] stream = new byte[length];
            stream = reader.ReadBytes(length);
            return(UTF8Encoding.UTF8.GetString(stream));
        }
 public override void SkipDirect(CompactBinaryReader reader, object graph)
 {
     String[] array = (String[])graph;
     for (int i = 0; i < array.Length; i++)
     {
         int length = reader.ReadInt16();
         if (length == 0)
         {
             array[i] = null;
             continue;
         }
         length = reader.ReadInt32();
         reader.ReadBytes(length);
     }
 }
Example #4
0
        public override object Read(CompactBinaryReader reader)
        {
            int count = reader.ReadInt32();

            try
            {
                byte[] bytes = new byte[count];
                bytes = reader.ReadBytes(count);
                return(Encoding.UTF8.GetString(bytes));
            }
            catch (OutOfMemoryException)
            {
                throw;
            }
        }
 public override void SkipDirect(CompactBinaryReader reader, object graph)
 {
     String[] array = (String[])graph;
     for (int i = 0; i < array.Length; i++)
     {
         int length = reader.ReadInt16();
         if (length == 0)
         {
             array[i] = null;
             continue;
         }
         length = reader.ReadInt32();
         reader.ReadBytes(length);
     }
 }
        public override object ReadDirect(CompactBinaryReader reader, object graph)
        {
            String[] array = (String[])graph;
            for (int i = 0; i < array.Length; i++)
            {
                if (reader.ReadInt16() == 0)
                    continue;

                int length = reader.ReadInt32();
               
                byte[] stream = new byte[length];
                stream = reader.ReadBytes(length);
                array[i] =  UTF8Encoding.UTF8.GetString(stream);
            }
            return array;
        }
Example #7
0
 public override void SkipDirect(CompactBinaryReader reader, object graph)
 {
     string[] strArray = (string[])graph;
     for (int i = 0; i < strArray.Length; i++)
     {
         if (reader.ReadInt16() == 0)
         {
             strArray[i] = null;
         }
         else
         {
             int count = reader.ReadInt32();
             reader.ReadBytes(count);
         }
     }
 }
        public override object ReadDirect(CompactBinaryReader reader, object graph)
        {
            String[] array = (String[])graph;
            for (int i = 0; i < array.Length; i++)
            {
                if (reader.ReadInt16() == 0)
                    continue;

                int length = reader.ReadInt32();

                byte[] stream = new byte[length];
                stream = reader.ReadBytes(length);
                array[i] =  UTF8Encoding.UTF8.GetString(stream);
                //array[i] = reader.ReadString();
            }
            return array;
        }
Example #9
0
 public override object ReadDirect(CompactBinaryReader reader, object graph)
 {
     string[] strArray = (string[])graph;
     for (int i = 0; i < strArray.Length; i++)
     {
         if (reader.ReadInt16() != 0)
         {
             int count = reader.ReadInt32();
             if (count == 0)
             {
                 strArray[i] = null;
             }
             else
             {
                 byte[] bytes = new byte[count];
                 bytes       = reader.ReadBytes(count);
                 strArray[i] = Encoding.UTF8.GetString(bytes);
             }
         }
     }
     return(strArray);
 }
Example #10
0
        public override object Read(CompactBinaryReader reader)
        {
            int length = reader.ReadInt32();

            return(reader.ReadBytes(length));
        }
 public override object Instantiate(CompactBinaryReader reader)
 {
     int length = reader.ReadInt32();
     return reader.ReadBytes(length);
 }
Example #12
0
        public override object Read(CompactBinaryReader reader)
        {
            int count = reader.ReadInt32();

            return(reader.ReadBytes(count));
        }