C# Class TagTool.IO.StreamUtil

ファイルを表示 Open project: TheGuardians/TagTool

Public Methods

Method Description
Align ( Stream stream, int align ) : void

Aligns the position of a stream to a power of two, padding the stream with zeroes.

Copy ( EndianReader input, EndianWriter output ) : void
Copy ( EndianReader input, EndianWriter output, int size ) : void
Copy ( Stream input, Stream output, int size ) : void

Copies data between two different streams.

Copy ( Stream stream, long originalPos, long targetPos, long size ) : void

Copies data between two locations in the same stream. The source and destination areas may overlap.

Fill ( Stream stream, byte b, int size ) : void

Fills a section of a stream with a repeating byte.

Insert ( Stream stream, int size, byte fill ) : void

Inserts space into a stream by copying everything back by a certain number of bytes.

Remove ( Stream stream, int size ) : void

Removes bytes from a stream, moving everything after the bytes to the current position and decreasing the stream length.

Method Details

Align() public static method

Aligns the position of a stream to a power of two, padding the stream with zeroes.
public static Align ( Stream stream, int align ) : void
stream Stream The stream.
align int The power of two to align to.
return void

Copy() public static method

public static Copy ( EndianReader input, EndianWriter output ) : void
input EndianReader
output EndianWriter
return void

Copy() public static method

public static Copy ( EndianReader input, EndianWriter output, int size ) : void
input EndianReader
output EndianWriter
size int
return void

Copy() public static method

Copies data between two different streams.
public static Copy ( Stream input, Stream output, int size ) : void
input Stream The stream to read from.
output Stream The stream to copy the read data to.
size int The size of the data to copy.
return void

Copy() public static method

Copies data between two locations in the same stream. The source and destination areas may overlap.
public static Copy ( Stream stream, long originalPos, long targetPos, long size ) : void
stream Stream The stream to copy data in.
originalPos long The position of the block of data to copy.
targetPos long The position to copy the block to.
size long The number of bytes to copy.
return void

Fill() public static method

Fills a section of a stream with a repeating byte.
public static Fill ( Stream stream, byte b, int size ) : void
stream Stream The stream to fill a section of.
b byte The byte to fill the section with.
size int The size of the section to fill.
return void

Insert() public static method

Inserts space into a stream by copying everything back by a certain number of bytes.
public static Insert ( Stream stream, int size, byte fill ) : void
stream Stream The stream to insert space into.
size int The size of the space to insert.
fill byte The byte to fill the inserted space with. See .
return void

Remove() public static method

Removes bytes from a stream, moving everything after the bytes to the current position and decreasing the stream length.
The size of the data to remove must be >= 0
public static Remove ( Stream stream, int size ) : void
stream Stream The stream to remove bytes from.
size int The number of bytes to remove.
return void