function s=filesink(ch,rate,file,varargin)
	str=sprintf('filesink(''%s'')',file);
	s=wavsink(ch,rate,@()filestream(file),@()str,varargin{:});
end

function [str,disp]=filestream(file)
	import  java.io.*;
	str=BufferedOutputStream(FileOutputStream(jfile(file)));
	disp=@nop;
end
