({{, (RefLink[RemoveInputStreamMethod, paclet:ref/RemoveInputStreamMethod])["name"] 
removes a custom input stream method.}})

OpenersNotesSection(Spacer1)Details

name should be the name passed to (RefLink[DefineInputStreamMethod, paclet:ref/DefineInputStreamMethod]) when the stream method was defined.

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)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:

$InputStreamMethods

Remove it:

RemoveInputStreamMethod["ChecksumFile"]

This input stream method is no longer defined:

$InputStreamMethods

Confirm that a stream cannot be opened with this stream method now:

OpenRead["ExampleData/USConstitution.txt",Method->"ChecksumFile"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[DefineInputStreamMethod, paclet:ref/DefineInputStreamMethod])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Stream Methods, paclet:tutorial/StreamMethods])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Stream Methods, paclet:guide/StreamMethods])}})}})