RemoveOutputStreamMethod["name"]
removes a custom output stream method.
RemoveOutputStreamMethod
RemoveOutputStreamMethod["name"]
removes a custom output stream method.
Details
- "name" should be the name passed to DefineOutputStreamMethod when the stream method was defined.
Examples
Basic Examples (1)
Define a stream method that keeps a checksum of the file contents:
ChecksumOutputStreamConstructor[name_, ___] :=
{"stream" -> OpenWrite[name, BinaryFormat -> True], "sum" -> 0}
ChecksumOutputStreamWrite[{"stream" -> st_OutputStream, "sum" -> previous_}, bytes_List] :=
With[{result = BinaryWrite[st, bytes]},
{Length[bytes], {"stream" -> st, "sum" -> previous + Total[bytes]}}
]
DefineOutputStreamMethod["ChecksumFile",
{"ConstructorFunction" -> ChecksumOutputStreamConstructor,
"CloseFunction" -> (Close["stream" /. #]&),
"WriteFunction" -> ChecksumOutputStreamWrite,
"OptionChangesFunction" -> (
{{{}, {"Checksum" -> ("sum" /. #)}}, #}&)
}]The new output stream method is listed:
$OutputStreamMethodsRemoveOutputStreamMethod["ChecksumFile"]This output stream method is no longer defined:
$OutputStreamMethodsConfirm that a stream cannot be opened with this stream method now:
OpenWrite[FileNameJoin[{$UserBaseDirectory, "example.txt"}], Method -> "ChecksumFile"]See Also
Tech Notes
Related Guides
History
Text
Wolfram Research (2012), RemoveOutputStreamMethod, Wolfram Language function, https://reference.wolfram.com/language/ref/RemoveOutputStreamMethod.html.
CMS
Wolfram Language. 2012. "RemoveOutputStreamMethod." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RemoveOutputStreamMethod.html.
APA
Wolfram Language. (2012). RemoveOutputStreamMethod. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RemoveOutputStreamMethod.html
BibTeX
@misc{reference.wolfram_2026_removeoutputstreammethod, author="Wolfram Research", title="{RemoveOutputStreamMethod}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/RemoveOutputStreamMethod.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_removeoutputstreammethod, organization={Wolfram Research}, title={RemoveOutputStreamMethod}, year={2012}, url={https://reference.wolfram.com/language/ref/RemoveOutputStreamMethod.html}, note=[Accessed: 13-June-2026]}