Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IReadable Pipe(IWriteable writeable)
- {
- this.OnData += data =>
- {
- this.Pause();
- writeable.Write(data, (exception) =>
- {
- if (exception != null)
- {
- if (this.OnError != null)
- {
- this.OnError(exception);
- }
- return;
- }
- this.Resume();
- });
- };
- this.OnEnd += () =>
- {
- writeable.End();
- };
- if (writeable is IReadable)
- {
- return writeable as IReadable;
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement