/// <summary>Writes a DICOM file header to a stream</summary>
        public static void WriteHeader(BufferedStreamWriter output, DicomFileMetaInformation fileMetaInformation)
        {
            output.WriteZeros(128);
            output.WriteBytes(BeforeFileMetaInformationLength);

            var fileMetaInformationLengthPosition = output.Position;

            output.WriteZeros(4);
            output.WriteBytes(AfterFileMetaInformationLength);

            var metaInformationWriter = DicomStreamWriter.Create(output, DicomUID.TransferSyntax.ExplicitVRLittleEndian);

            FileMetaInformationSerializer.Serialize(metaInformationWriter, fileMetaInformation);

            var endOfFileMetaInformationPosition = output.Position;

            output.Flush(FlushMode.Shallow);

            var fileMetaInformationLength = endOfFileMetaInformationPosition - (fileMetaInformationLengthPosition + 4);

            output.Stream.Seek(fileMetaInformationLengthPosition, SeekOrigin.Begin);
            output.Stream.Write(BitConverter.GetBytes((uint)fileMetaInformationLength));
            output.Stream.Seek(endOfFileMetaInformationPosition, SeekOrigin.Begin);
        }