Was this page helpful?

StreamUtil Static Class

    Table of contents
    1. 1. Members
      1. 1.1. Fields
      2. 1.2. Methods
    Table of Contents
    public static class StreamUtil
    Namespace: MindTouch.IO
    Assembly: mindtouch.dream
    Type Hierarchy:
    • object
      • StreamUtil
    A set of static and extension methods to simplify common stream opreations and add MindTouch.Tasking.Result based asynchronous operations

    Members

    Fields

    Visibility Description
    Public BUFFER_SIZE Common size for internal byte buffer used for Stream operations

    Methods

    Visibility Description
    Public Write(this Stream stream, Encoding encoding, string text, params Object[] args) (Extension) Write a string to System.IO.Stream
    Public Write(this Stream stream, Byte[] buffer) (Extension) Write an entire buffer to a System.IO.Stream
    Public IsStreamMemorized(this Stream stream) (Extension) Determine whether a System.IO.Stream contents are in memory
    Public Read(this Stream stream, Byte[] buffer, int offset, int count, Result<int> result) (Extension) Asynchronously read from a System.IO.Stream
    Public Write(this Stream stream, Byte[] buffer, int offset, int count, Result result) (Extension) Asynchronously write to a System.IO.Stream.
    Public CopyTo(this Stream source, Stream target, long length) (Extension) Synchronous copying of one stream to another.
    Public CopyTo(this Stream source, Stream target, long length, Result<long> result) (Extension) Asynchronous copying of one stream to another.
    Public CopyTo(this Stream source, Stream[] targets, long length, Result<Nullable`1[]> result) (Extension)
    Public CopyToFile(this Stream stream, string filename, long length) (Extension) WARNING: This method is thread-blocking. Please avoid using it if possible.
    Public Pad(this Stream stream, long count, byte value, Result result) (Extension) Asychronously Pad a stream with a sequence of bytes
    Public ComputeHash(this Stream stream) (Extension) Compute the MD5 hash.
    Public ComputeHashString(this Stream stream) (Extension) Compute the MD5 hash string.
    Public ReadBytes(this Stream source, long length) (Extension) WARNING: This method is thread-blocking. Please avoid using it if possible.
    Public ToMemoryStream(this Stream stream, long length, Result<MemoryStream> result) (Extension) WARNING: This method is thread-blocking. Please avoid using it if possible.
    Public ToChunkedMemoryStream(this Stream stream, long length, Result<ChunkedMemoryStream> result) (Extension) WARNING: This method is thread-blocking. Please avoid using it if possible.
    Public DupStream(Stream stream, long length, int copies) WARNING: This method is thread-blocking. Please avoid using it if possible.
    Public FileOpenExclusive(string filename) Try to open a file for exclusive read/write access
    Public CreatePipe(out Stream writer, out Stream reader) Create a pipe
    Public CreatePipe(int size, out Stream writer, out Stream reader) Create a pipe
    Public ToString() (Inherited from Object)
    Public Equals(object obj) (Inherited from Object)
    Public GetHashCode() (Inherited from Object)
    Public GetType() (Inherited from Object)
    Protected MemberwiseClone() (Inherited from Object)
    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by