internal void WriteHeader(string schema, CodecType codecType)
        {
            GenerateSyncData();
            _header.AddMetadata(DataFileConstants.CodecMetadataKey, AbstractCodec.CreateCodec(codecType).Name);
            _header.AddMetadata(DataFileConstants.SchemaMetadataKey, schema);

            _writer.WriteHeader(_header);
        }
Beispiel #2
0
        internal Encoder(Schema.Schema schema, Stream outStream, CodecType codecType)
        {
            _codec        = AbstractCodec.CreateCodec(codecType);
            _stream       = outStream;
            _metadata     = new Metadata();
            _schema       = schema;
            _syncInterval = DataFileConstants.DefaultSyncInterval;

            _blockCount   = 0;
            _encoder      = new Writer(_stream);
            _blockStream  = new MemoryStream();
            _blockEncoder = new Writer(_blockStream);

            _writer = Resolver.ResolveWriter(schema);

            _isOpen = true;
        }
Beispiel #3
0
        internal Encoder(TypeSchema schema, Stream outStream, CodecType codecType)
        {
            _codec        = AbstractCodec.CreateCodec(codecType);
            _stream       = outStream;
            _header       = new Header();
            _schema       = schema;
            _syncInterval = DataFileConstants.DefaultSyncInterval;

            _blockCount = 0;
            _writer     = new Writer(_stream);
            _tempBuffer = new MemoryStream();
            _tempWriter = new Writer(_tempBuffer);

            GenerateSyncData();
            _header.AddMetadata(DataFileConstants.CodecMetadataKey, _codec.Name);
            _header.AddMetadata(DataFileConstants.SchemaMetadataKey, _schema.ToString());

            _writeItem = Resolver.ResolveWriter(schema);

            _isOpen = true;
        }