C# 클래스 CoreTechs.Common.StreamExtensions

파일 보기 프로젝트 열기: Core-Techs/Common

공개 메소드들

메소드 설명
Bookmark ( this stream ) : StreamBookmark

Creates a StreamBookmark.

CountBytesUntil ( this stream, byte target ) : long

Counts the number of bytes between the current position and the target byte sequence. The starting position is returned to once the target is found or the end of the stream is reached.

CountBytesUntil ( this stream, string target, Encoding encoding = null ) : long

Counts the number of bytes between the current position and the target string. The starting position is returned to once the target is found or the end of the stream is reached.

CountBytesUntilAny ( this stream, byte targets, byte &targetFound ) : long

Counts the number of bytes between the current position and the first occurrence of any of the target byte sequences. The starting position is returned to once a target is found or the end of the stream is reached.

CountBytesUntilAny ( this stream, string targets, string &targetFound, Encoding encoding = null ) : long

Counts the number of bytes between the current position and the first occurrence of any of the target strings. The starting position is returned to once a target is found or the end of the stream is reached.

EnumerateBytes ( this stream ) : IEnumerable
EnumerateBytesUntil ( this stream, byte target, bool positionAfterTarget = false ) : IEnumerable

Enumerates the bytes until the target begins or the end of the stream.

EnumerateBytesUntil ( this stream, string target, bool positionAfterTarget = false, Encoding encoding = null ) : IEnumerable

Enumerates the bytes until the target begins or the end of the stream.

EnumerateBytesUntilAny ( this stream, byte targets, bool positionAfterTarget = false ) : IEnumerable

Enumerates the bytes until any of the target byte sequences begin or the end of the stream.

EnumerateBytesUntilAny ( this stream, string targets, bool positionAfterTarget = false, Encoding encoding = null ) : IEnumerable

Enumerates the bytes until any of the target strings begin or the end of the stream.

SeekEndOf ( this stream, byte target ) : bool

Seeks to the position after the end of the next occurrence of the target byte sequence in the stream.

SeekEndOf ( this stream, string target, Encoding encoding = null ) : bool

Seeks to the position after the end of the next occurrence of the target string in the stream.

SeekEndOfAny ( this stream ) : byte[]

Seeks to the position after the end of the next occurrence of any of the target byte sequences found in the stream.

SeekEndOfAny ( this stream ) : string

Seeks to the position after the end of the next occurrence of any of the target strings found in the stream.

SeekEndOfAny ( this stream, Encoding encoding ) : string

Seeks to the position after the end of the next occurrence of any of the target strings found in the stream.

SeekStartOf ( this stream, byte target ) : bool

Seeks to the position of the next occurrence of the target byte sequence in the stream.

SeekStartOf ( this stream, string target, Encoding encoding = null ) : bool

Seeks to the position of the next occurrence of the target string in the stream.

SeekStartOfAny ( this stream ) : byte[]

Seeks to the position after the end of the next occurrence of any of the target byte sequences found in the stream.

SeekStartOfAny ( this stream ) : string

Seeks to the position after the end of the next occurrence of any of the target byte sequences found in the stream.

SeekStartOfAny ( this stream, Encoding encoding ) : string

Seeks to the position after the end of the next occurrence of any of the target byte sequences found in the stream.

ToMemoryStream ( this bytes ) : MemoryStream

메소드 상세

Bookmark() 공개 정적인 메소드

Creates a StreamBookmark.
public static Bookmark ( this stream ) : StreamBookmark
stream this
리턴 StreamBookmark

CountBytesUntil() 공개 정적인 메소드

Counts the number of bytes between the current position and the target byte sequence. The starting position is returned to once the target is found or the end of the stream is reached.
public static CountBytesUntil ( this stream, byte target ) : long
stream this
target byte
리턴 long

CountBytesUntil() 공개 정적인 메소드

Counts the number of bytes between the current position and the target string. The starting position is returned to once the target is found or the end of the stream is reached.
public static CountBytesUntil ( this stream, string target, Encoding encoding = null ) : long
stream this
target string
encoding System.Text.Encoding
리턴 long

CountBytesUntilAny() 공개 정적인 메소드

Counts the number of bytes between the current position and the first occurrence of any of the target byte sequences. The starting position is returned to once a target is found or the end of the stream is reached.
public static CountBytesUntilAny ( this stream, byte targets, byte &targetFound ) : long
stream this
targets byte
targetFound byte
리턴 long

CountBytesUntilAny() 공개 정적인 메소드

Counts the number of bytes between the current position and the first occurrence of any of the target strings. The starting position is returned to once a target is found or the end of the stream is reached.
public static CountBytesUntilAny ( this stream, string targets, string &targetFound, Encoding encoding = null ) : long
stream this
targets string
targetFound string The string that was found first or null if no target was found.
encoding System.Text.Encoding
리턴 long

EnumerateBytes() 공개 정적인 메소드

public static EnumerateBytes ( this stream ) : IEnumerable
stream this
리턴 IEnumerable

EnumerateBytesUntil() 공개 정적인 메소드

Enumerates the bytes until the target begins or the end of the stream.
public static EnumerateBytesUntil ( this stream, byte target, bool positionAfterTarget = false ) : IEnumerable
stream this
target byte The target to search for.
positionAfterTarget bool True to seek to the end of the target after enumeration; false to keep position at beginning of target.
리턴 IEnumerable

EnumerateBytesUntil() 공개 정적인 메소드

Enumerates the bytes until the target begins or the end of the stream.
public static EnumerateBytesUntil ( this stream, string target, bool positionAfterTarget = false, Encoding encoding = null ) : IEnumerable
stream this
target string The target to search for.
positionAfterTarget bool True to seek to the end of the target after enumeration; false to keep position at beginning of target.
encoding System.Text.Encoding The encoding used to decode the target string.
리턴 IEnumerable

EnumerateBytesUntilAny() 공개 정적인 메소드

Enumerates the bytes until any of the target byte sequences begin or the end of the stream.
public static EnumerateBytesUntilAny ( this stream, byte targets, bool positionAfterTarget = false ) : IEnumerable
stream this
targets byte The targets to search for.
positionAfterTarget bool True to seek to the end of the found target after enumeration; false to keep position at beginning of target.
리턴 IEnumerable

EnumerateBytesUntilAny() 공개 정적인 메소드

Enumerates the bytes until any of the target strings begin or the end of the stream.
public static EnumerateBytesUntilAny ( this stream, string targets, bool positionAfterTarget = false, Encoding encoding = null ) : IEnumerable
stream this
targets string The targets to search for.
positionAfterTarget bool True to seek to the end of the found target after enumeration; false to keep position at beginning of target.
encoding System.Text.Encoding The encoding used to decode the target strings.
리턴 IEnumerable

SeekEndOf() 공개 정적인 메소드

Seeks to the position after the end of the next occurrence of the target byte sequence in the stream.
public static SeekEndOf ( this stream, byte target ) : bool
stream this
target byte
리턴 bool

SeekEndOf() 공개 정적인 메소드

Seeks to the position after the end of the next occurrence of the target string in the stream.
public static SeekEndOf ( this stream, string target, Encoding encoding = null ) : bool
stream this
target string
encoding System.Text.Encoding
리턴 bool

SeekEndOfAny() 공개 정적인 메소드

Seeks to the position after the end of the next occurrence of any of the target byte sequences found in the stream.
public static SeekEndOfAny ( this stream ) : byte[]
stream this
리턴 byte[]

SeekEndOfAny() 공개 정적인 메소드

Seeks to the position after the end of the next occurrence of any of the target strings found in the stream.
public static SeekEndOfAny ( this stream ) : string
stream this
리턴 string

SeekEndOfAny() 공개 정적인 메소드

Seeks to the position after the end of the next occurrence of any of the target strings found in the stream.
public static SeekEndOfAny ( this stream, Encoding encoding ) : string
stream this
encoding System.Text.Encoding
리턴 string

SeekStartOf() 공개 정적인 메소드

Seeks to the position of the next occurrence of the target byte sequence in the stream.
public static SeekStartOf ( this stream, byte target ) : bool
stream this
target byte
리턴 bool

SeekStartOf() 공개 정적인 메소드

Seeks to the position of the next occurrence of the target string in the stream.
public static SeekStartOf ( this stream, string target, Encoding encoding = null ) : bool
stream this
target string
encoding System.Text.Encoding
리턴 bool

SeekStartOfAny() 공개 정적인 메소드

Seeks to the position after the end of the next occurrence of any of the target byte sequences found in the stream.
public static SeekStartOfAny ( this stream ) : byte[]
stream this
리턴 byte[]

SeekStartOfAny() 공개 정적인 메소드

Seeks to the position after the end of the next occurrence of any of the target byte sequences found in the stream.
public static SeekStartOfAny ( this stream ) : string
stream this
리턴 string

SeekStartOfAny() 공개 정적인 메소드

Seeks to the position after the end of the next occurrence of any of the target byte sequences found in the stream.
public static SeekStartOfAny ( this stream, Encoding encoding ) : string
stream this
encoding System.Text.Encoding
리턴 string

ToMemoryStream() 공개 정적인 메소드

public static ToMemoryStream ( this bytes ) : MemoryStream
bytes this
리턴 System.IO.MemoryStream