RemoveInputStreamMethod["name"]
removes a custom input stream method.
RemoveInputStreamMethod
RemoveInputStreamMethod["name"]
removes a custom input stream method.
Details
- name should be the name passed to DefineInputStreamMethod when the stream method was defined.
Examples
Basic Examples (1)
Define a stream method that keeps a checksum of the file contents:
ChecksumConstructor[name_, ___] :=
{"stream" -> OpenRead[name, BinaryFormat -> True], "sum" -> 0}
ChecksumRead[{"stream" -> st_InputStream, "sum" -> previous_}, nBytes_] :=
With[{bytes = BinaryReadList[st, "Byte", nBytes]},
{bytes, {"stream" -> st, "sum" -> previous + Total[bytes]}}
]
DefineInputStreamMethod["ChecksumFile",
{"ConstructorFunction" -> ChecksumConstructor,
"CloseFunction" -> (Close["stream" /. #]&),
"ReadFunction" -> ChecksumRead,
"OptionChangesFunction" -> (
{{{}, {"Checksum" -> ("sum" /. #)}}, #}&)
}]Check that the new input stream method is listed:
$InputStreamMethodsRemoveInputStreamMethod["ChecksumFile"]This input stream method is no longer defined:
$InputStreamMethodsConfirm that a stream cannot be opened with this stream method now:
OpenRead["ExampleData/USConstitution.txt", Method -> "ChecksumFile"]See Also
Tech Notes
Related Guides
History
Text
Wolfram Research (2012), RemoveInputStreamMethod, Wolfram Language function, https://reference.wolfram.com/language/ref/RemoveInputStreamMethod.html.
CMS
Wolfram Language. 2012. "RemoveInputStreamMethod." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RemoveInputStreamMethod.html.
APA
Wolfram Language. (2012). RemoveInputStreamMethod. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RemoveInputStreamMethod.html
BibTeX
@misc{reference.wolfram_2026_removeinputstreammethod, author="Wolfram Research", title="{RemoveInputStreamMethod}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/RemoveInputStreamMethod.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_removeinputstreammethod, organization={Wolfram Research}, title={RemoveInputStreamMethod}, year={2012}, url={https://reference.wolfram.com/language/ref/RemoveInputStreamMethod.html}, note=[Accessed: 13-June-2026]}