Show / Hide Table of Contents

Class StreamUtils

Provides simple System.IO.Stream" utilities.

Inheritance
System.Object
StreamUtils
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ICSharpCode.SharpZipLib.Core
Assembly: ICSharpCode.SharpZipLib.dll
Syntax
public static class StreamUtils

Methods

| Improve this Doc View Source

Copy(Stream, Stream, Byte[])

Copy the contents of one System.IO.Stream to another.

Declaration
public static void Copy(Stream source, Stream destination, byte[] buffer)
Parameters
Type Name Description
System.IO.Stream source

The stream to source data from.

System.IO.Stream destination

The stream to write data to.

System.Byte[] buffer

The buffer to use during copying.

| Improve this Doc View Source

Copy(Stream, Stream, Byte[], ProgressHandler, TimeSpan, Object, String)

Copy the contents of one System.IO.Stream to another.

Declaration
public static void Copy(Stream source, Stream destination, byte[] buffer, ProgressHandler progressHandler, TimeSpan updateInterval, object sender, string name)
Parameters
Type Name Description
System.IO.Stream source

The stream to source data from.

System.IO.Stream destination

The stream to write data to.

System.Byte[] buffer

The buffer to use during copying.

ProgressHandler progressHandler

The progress handler delegate to use.

System.TimeSpan updateInterval

The minimum System.TimeSpan between progress updates.

System.Object sender

The source for this event.

System.String name

The name to use with the event.

Remarks

This form is specialised for use within #Zip to support events during archive operations.

| Improve this Doc View Source

Copy(Stream, Stream, Byte[], ProgressHandler, TimeSpan, Object, String, Int64)

Copy the contents of one System.IO.Stream to another.

Declaration
public static void Copy(Stream source, Stream destination, byte[] buffer, ProgressHandler progressHandler, TimeSpan updateInterval, object sender, string name, long fixedTarget)
Parameters
Type Name Description
System.IO.Stream source

The stream to source data from.

System.IO.Stream destination

The stream to write data to.

System.Byte[] buffer

The buffer to use during copying.

ProgressHandler progressHandler

The progress handler delegate to use.

System.TimeSpan updateInterval

The minimum System.TimeSpan between progress updates.

System.Object sender

The source for this event.

System.String name

The name to use with the event.

System.Int64 fixedTarget

A predetermined fixed target value to use with progress updates. If the value is negative the target is calculated by looking at the stream.

Remarks

This form is specialised for use within #Zip to support events during archive operations.

| Improve this Doc View Source

ReadFully(Stream, Byte[])

Read from a System.IO.Stream ensuring all the required data is read.

Declaration
public static void ReadFully(Stream stream, byte[] buffer)
Parameters
Type Name Description
System.IO.Stream stream

The stream to read.

System.Byte[] buffer

The buffer to fill.

See Also
ReadFully(Stream, Byte[], Int32, Int32)
| Improve this Doc View Source

ReadFully(Stream, Byte[], Int32, Int32)

Read from a System.IO.Stream" ensuring all the required data is read.

Declaration
public static void ReadFully(Stream stream, byte[] buffer, int offset, int count)
Parameters
Type Name Description
System.IO.Stream stream

The stream to read data from.

System.Byte[] buffer

The buffer to store data in.

System.Int32 offset

The offset at which to begin storing data.

System.Int32 count

The number of bytes of data to store.

Exceptions
Type Condition
System.ArgumentNullException

Required parameter is null

System.ArgumentOutOfRangeException

offset and or count are invalid.

System.IO.EndOfStreamException

End of stream is encountered before all the data has been read.

| Improve this Doc View Source

ReadRequestedBytes(Stream, Byte[], Int32, Int32)

Read as much data as possible from a System.IO.Stream", up to the requested number of bytes

Declaration
public static int ReadRequestedBytes(Stream stream, byte[] buffer, int offset, int count)
Parameters
Type Name Description
System.IO.Stream stream

The stream to read data from.

System.Byte[] buffer

The buffer to store data in.

System.Int32 offset

The offset at which to begin storing data.

System.Int32 count

The number of bytes of data to store.

Returns
Type Description
System.Int32
Exceptions
Type Condition
System.ArgumentNullException

Required parameter is null

System.ArgumentOutOfRangeException

offset and or count are invalid.

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2000-2022 SharpZipLib Contributors