mirror of
https://github.com/chylex/Brotli-Builder.git
synced 2024-12-22 16:42:46 +01:00
30 lines
835 B
C#
30 lines
835 B
C#
using System;
|
|
using BrotliLib.Brotli.Components;
|
|
using BrotliLib.Brotli.Parameters;
|
|
|
|
namespace BrotliLib.Brotli.Streaming{
|
|
/// <summary>
|
|
/// Provides a streaming meta-block generator.
|
|
/// </summary>
|
|
public interface IBrotliFileStream{
|
|
BrotliFileParameters Parameters { get; }
|
|
BrotliGlobalState State { get; }
|
|
|
|
MetaBlock? NextMetaBlock();
|
|
|
|
void ForEachRemainingMetaBlock(Action<MetaBlock> action){
|
|
MetaBlock? metaBlock;
|
|
|
|
while((metaBlock = NextMetaBlock()) != null){
|
|
action(metaBlock);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static class IBrotliFileStreamExtensions{
|
|
public static void ForEachRemainingMetaBlock(this IBrotliFileStream me, Action<MetaBlock> action){
|
|
me.ForEachRemainingMetaBlock(action);
|
|
}
|
|
}
|
|
}
|