C# Class NSoft.NFramework.IO.StreamTool

Stream 개체에 Value type 정보를 read/write할 수있는 Utility class
Serializable 객체를 사용하면 되겠지만, 지정된 Stream에 기록할 때 쓰는 고전적인 방법이다.
Show file Open project: debop/NFramework Class Usage Examples

Public Methods

Method Description
CopyStreamToStream ( this srcStream, Stream destStream ) : void

srcStream 스트림을 읽어, destStream에 쓴다.

CopyStreamToStream ( this srcStream, Stream destStream, int bufferSize ) : void

srcStream 스트림을 읽어, destStream에 쓴다.

Read ( this stream, Stream &target ) : void

지정된 stream을 읽어서 target에 저장한다.

Read ( this stream, bool &v ) : void

지정된 stream을 읽어서 값을 반환한다.

Read ( this stream, char &v ) : void

지정된 stream을 읽어서 값을 반환한다.

Read ( this stream, double &v ) : void

지정된 stream을 읽어서 값을 반환한다.

Read ( this stream, float &v ) : void

지정된 stream을 읽어서 값을 반환한다.

Read ( this stream, int &v ) : void

지정된 stream을 읽어서 값을 반환한다.

Read ( this stream, long &v ) : void

지정된 stream을 읽어서 값을 반환한다.

Read ( this stream, short &v ) : void

지정된 stream을 읽어서 값을 반환한다.

Read ( this stream, string &v ) : void

지정된 stream을 읽어서 값을 반환한다.

ReadAllBytes ( this stream ) : byte[]

stream 의 현재 위치부터 끝까지 읽어서 바이트배열로 변환합니다.

ReadBoolean ( this stream ) : bool

stream에서 값 읽어오기

ReadBytes ( this stream, int length ) : byte[]

stream에서 값 읽어오기

ReadChar ( this stream ) : Char

stream에서 값 읽어오기

ReadDouble ( this stream ) : double

stream에서 값 읽어오기

ReadFloat ( this stream ) : float

stream에서 값 읽어오기

ReadInt16 ( this stream ) : Int16

stream에서 값 읽어오기

ReadInt32 ( this stream ) : Int32

stream에서 값 읽어오기

ReadInt64 ( this stream ) : System.Int64

stream에서 값 읽어오기

ReadStream ( this stream ) : Stream

stream에서 값 읽어오기

ReadString ( this stream ) : string

stream에서 값 읽어오기

SetStreamPosition ( this stream, int position ) : Stream

Stream의 Position을 변경한다.

Write ( this stream, Stream source ) : void

원본 스트림을 대상 스트림에 쓴다.

원본 스트림의 크기를 먼저 대상 스트림에 기록하고, 내용을 쓴다. 읽어 올 때도 크기를 먼저 읽고, 그 크기 만큼 내용을 읽어온다.

Write ( this stream, bool v ) : void

스트림에 값 쓰기

Write ( this stream, char v ) : void

스트림에 값 쓰기

Write ( this stream, double v ) : void

스트림에 값 쓰기

Write ( this stream, float v ) : void

스트림에 값 쓰기

Write ( this stream, int v ) : void

스트림에 값 쓰기

Write ( this stream, long v ) : void

스트림에 값 쓰기

Write ( this stream, short v ) : void

스트림에 값 쓰기

Write ( this stream, string v ) : void

스트림에 값 쓰기

Private Methods

Method Description
Read ( this stream, byte v ) : void

지정된 stream을 읽어서 값을 반환한다.

Read ( this stream, uint &v ) : void
Read ( this stream, ulong &v ) : void
Read ( this stream, ushort &v ) : void
ReadUInt16 ( this stream ) : UInt16
ReadUInt32 ( this stream ) : UInt32
ReadUInt64 ( this stream ) : System.UInt64
Write ( this stream, byte v ) : void

스트림에 값 쓰기

Write ( this stream, uint v ) : void
Write ( this stream, ulong v ) : void
Write ( this stream, ushort v ) : void

Method Details

CopyStreamToStream() public static method

srcStream 스트림을 읽어, destStream에 쓴다.
public static CopyStreamToStream ( this srcStream, Stream destStream ) : void
srcStream this 원본 스트림
destStream Stream 대상 스트림
return void

CopyStreamToStream() public static method

srcStream 스트림을 읽어, destStream에 쓴다.
public static CopyStreamToStream ( this srcStream, Stream destStream, int bufferSize ) : void
srcStream this 원본 스트림
destStream Stream 대상 스트림
bufferSize int 버퍼 크기
return void

Read() public static method

지정된 stream을 읽어서 target에 저장한다.
public static Read ( this stream, Stream &target ) : void
stream this 읽을 대상 인스턴스
target Stream 읽은 값을 저장한 인스턴스
return void

Read() public static method

지정된 stream을 읽어서 값을 반환한다.
public static Read ( this stream, bool &v ) : void
stream this 읽을 대상 인스턴스
v bool 읽은 값
return void

Read() public static method

지정된 stream을 읽어서 값을 반환한다.
public static Read ( this stream, char &v ) : void
stream this 읽을 대상 인스턴스
v char 읽은 값
return void

Read() public static method

지정된 stream을 읽어서 값을 반환한다.
public static Read ( this stream, double &v ) : void
stream this 읽을 대상 인스턴스
v double 읽은 값
return void

Read() public static method

지정된 stream을 읽어서 값을 반환한다.
public static Read ( this stream, float &v ) : void
stream this 읽을 대상 인스턴스
v float 읽은 값
return void

Read() public static method

지정된 stream을 읽어서 값을 반환한다.
public static Read ( this stream, int &v ) : void
stream this 읽을 대상 인스턴스
v int 읽은 값
return void

Read() public static method

지정된 stream을 읽어서 값을 반환한다.
public static Read ( this stream, long &v ) : void
stream this 읽을 대상 인스턴스
v long 읽은 값
return void

Read() public static method

지정된 stream을 읽어서 값을 반환한다.
public static Read ( this stream, short &v ) : void
stream this 읽을 대상 인스턴스
v short 읽은 값
return void

Read() public static method

지정된 stream을 읽어서 값을 반환한다.
public static Read ( this stream, string &v ) : void
stream this 읽을 대상 인스턴스
v string 읽은 값
return void

ReadAllBytes() public static method

stream 의 현재 위치부터 끝까지 읽어서 바이트배열로 변환합니다.
public static ReadAllBytes ( this stream ) : byte[]
stream this 읽을 스트림
return byte[]

ReadBoolean() public static method

stream에서 값 읽어오기
public static ReadBoolean ( this stream ) : bool
stream this 대상 Stream 객체
return bool

ReadBytes() public static method

stream에서 값 읽어오기
public static ReadBytes ( this stream, int length ) : byte[]
stream this 대상 Stream 객체
length int 읽을 길이
return byte[]

ReadChar() public static method

stream에서 값 읽어오기
public static ReadChar ( this stream ) : Char
stream this 대상 Stream 객체
return Char

ReadDouble() public static method

stream에서 값 읽어오기
public static ReadDouble ( this stream ) : double
stream this 대상 Stream 객체
return double

ReadFloat() public static method

stream에서 값 읽어오기
public static ReadFloat ( this stream ) : float
stream this 대상 Stream 객체
return float

ReadInt16() public static method

stream에서 값 읽어오기
public static ReadInt16 ( this stream ) : Int16
stream this 대상 Stream 객체
return System.Int16

ReadInt32() public static method

stream에서 값 읽어오기
public static ReadInt32 ( this stream ) : Int32
stream this 대상 Stream 객체
return System.Int32

ReadInt64() public static method

stream에서 값 읽어오기
public static ReadInt64 ( this stream ) : System.Int64
stream this 대상 Stream 객체
return System.Int64

ReadStream() public static method

stream에서 값 읽어오기
public static ReadStream ( this stream ) : Stream
stream this 대상 Stream 객체
return Stream

ReadString() public static method

stream에서 값 읽어오기
public static ReadString ( this stream ) : string
stream this 대상 Stream 객체
return string

SetStreamPosition() public static method

Stream의 Position을 변경한다.
포지션이 스트림 객체의 크기보다 클때
public static SetStreamPosition ( this stream, int position ) : Stream
stream this 대상 스트림 객체
position int 지정된 포지션
return Stream

Write() public static method

원본 스트림을 대상 스트림에 쓴다.
원본 스트림의 크기를 먼저 대상 스트림에 기록하고, 내용을 쓴다. 읽어 올 때도 크기를 먼저 읽고, 그 크기 만큼 내용을 읽어온다.
public static Write ( this stream, Stream source ) : void
stream this 복사 대상 스트림
source Stream 원본 스트림
return void

Write() public static method

스트림에 값 쓰기
public static Write ( this stream, bool v ) : void
stream this 대상 Stream 객체
v bool 쓸 값
return void

Write() public static method

스트림에 값 쓰기
public static Write ( this stream, char v ) : void
stream this 대상 Stream 객체
v char 쓸 값
return void

Write() public static method

스트림에 값 쓰기
public static Write ( this stream, double v ) : void
stream this 대상 Stream 객체
v double 쓸 값
return void

Write() public static method

스트림에 값 쓰기
public static Write ( this stream, float v ) : void
stream this 대상 Stream 객체
v float 쓸 값
return void

Write() public static method

스트림에 값 쓰기
public static Write ( this stream, int v ) : void
stream this 대상 Stream 객체
v int 쓸 값
return void

Write() public static method

스트림에 값 쓰기
public static Write ( this stream, long v ) : void
stream this 대상 Stream 객체
v long 쓸 값
return void

Write() public static method

스트림에 값 쓰기
public static Write ( this stream, short v ) : void
stream this 대상 Stream 객체
v short 쓸 값
return void

Write() public static method

스트림에 값 쓰기
public static Write ( this stream, string v ) : void
stream this 대상 Stream 객체
v string 쓸 값
return void