public EndianStream StreamSignature(ulong signature) { if (IsReading) { SignatureMismatchException.Assert(Reader, signature); } else if (IsWriting) { Writer.Write(signature); } return(this); }
public EndianStream StreamSignature(string signature, Memory.Strings.StringStorage storage) { Contract.Requires(!string.IsNullOrEmpty(signature)); if (IsReading) { SignatureMismatchException.Assert(Reader, signature, storage); } else if (IsWriting) { Writer.Write(signature, storage); } return(this); }
public EndianStream StreamSignature(string signature, Text.StringStorageEncoding encoding) { Contract.Requires(!string.IsNullOrEmpty(signature)); Contract.Requires(encoding != null); if (IsReading) { SignatureMismatchException.Assert(Reader, signature, encoding); } else if (IsWriting) { Writer.Write(signature, encoding); } return(this); }