Пример #1
0
        public void TempTest()
        {
            /*
             * <metadata_size: int32>
             * <metadata_flatbuffer: bytes>
             * <padding>
             * <message body>
             */

            Span <byte> span = _streamMemory.Span;

            int metaLength = span.ReadInt32();

            metaLength = 339;

            FB.Schema schema = FB.Schema.GetRootAsSchema(new ByteBuffer(span.Slice(4, metaLength).ToArray()));

            //stream always begins with schema

            /*foreach (FB.Block block in _records)
             * {
             * int length = BitConverter.ToInt32(_fileData.Slice(0, 4).Span.ToArray(), 0);
             *
             * byte[] messageData = _fileData.Slice((int)block.Offset + 4, block.MetaDataLength).ToArray();
             * var message = Message.CreateFromData(messageData);
             * }*/
        }
Пример #2
0
        internal Schema(FB.Schema fbSchema)
        {
            for (int i = 0; i < fbSchema.FieldsLength; i++)
            {
                FB.Field field = fbSchema.Fields(i).GetValueOrDefault();

                _fields.Add(new Field(field));
            }
        }
Пример #3
0
        private void ReadFields(FB.Schema fbSchema)
        {
            for (int i = 0; i < fbSchema.FieldsLength; i++)
            {
                FB.Field field = fbSchema.Fields(i).GetValueOrDefault();

                for (int mi = 0; mi < field.CustomMetadataLength; mi++)
                {
                    FB.KeyValue mkv = field.CustomMetadata(mi).GetValueOrDefault();
                }

                _fields.Add(new Field(field));
            }
        }
Пример #4
0
 internal Schema(FB.Schema fbSchema)
 {
     ReadFields(fbSchema);
 }