Table of Contents

Method LooksLikeCompoundFile

Namespace
DocWright.Cryptography
Assembly
DocWright.Cryptography.dll

LooksLikeCompoundFile(Stream)

Returns whether the bytes begin with the Compound File Binary magic number. This is the cheap half of the sniff: eight bytes, no parsing.

public static bool LooksLikeCompoundFile(Stream stream)

Parameters

stream Stream

A seekable stream. Its position is restored before returning.

Returns

bool

true when the stream starts with the CFB magic number.

Exceptions

ArgumentNullException

stream is null.

ArgumentException

stream is not seekable.