C# 클래스 TrainerEditor.CompressionFormat

Base class for all compression formats.
파일 보기 프로젝트 열기: Jambo51/Trainer_Editor

공개 메소드들

메소드 설명
Compress ( Stream instream, long inLength, Stream outstream ) : int

Compresses the next inLength bytes from the input stream, and writes the compressed data to the given output stream.

Compress ( string infile, string outfile ) : int

Compresses the given input file, and writes the compressed data to the given output file.

Decompress ( Stream instream, long inLength, Stream outstream ) : long

Decompresses the given stream, writing the decompressed data to the given output stream. Assumes Supports(instream) returns true. After this call, the input stream will be positioned at the end of the compressed stream, or at the initial position + inLength, whichever comes first.

Decompress ( string infile, string outfile ) : void

Decompresses the given file, writing the deocmpressed data to the given output file. The output file will be overwritten if it already exists. Assumes Supports(infile) returns true.

ParseCompressionOptions ( string args ) : int

Parses any input specific for this format. Does nothing by default.

Supports ( Stream stream, long inLength ) : bool

Checks if the decompressor for this format supports the data from the given stream. Returns false when it is certain that the given data is not supported. False positives may occur, as this method should not do any decompression, and may mis-interpret a similar data format as compressed.

Supports ( string file ) : bool

Checks if the decompressor for this format supports the given file. Assumes the file exists. Returns false when it is certain that the given file is not supported. False positives may occur, as this method should not do any decompression, and may mis-interpret a similar file format as compressed.

메소드 상세

Compress() 공개 추상적인 메소드

Compresses the next inLength bytes from the input stream, and writes the compressed data to the given output stream.
public abstract Compress ( Stream instream, long inLength, Stream outstream ) : int
instream Stream The stream to read plaintext data from.
inLength long The length of the plaintext data.
outstream Stream The stream to write the compressed data to.
리턴 int

Compress() 공개 메소드

Compresses the given input file, and writes the compressed data to the given output file.
public Compress ( string infile, string outfile ) : int
infile string The file to compress.
outfile string The file to write the compressed data to.
리턴 int

Decompress() 공개 추상적인 메소드

Decompresses the given stream, writing the decompressed data to the given output stream. Assumes Supports(instream) returns true. After this call, the input stream will be positioned at the end of the compressed stream, or at the initial position + inLength, whichever comes first.
When the given length of the input data /// is not enough to properly decompress the input.
public abstract Decompress ( Stream instream, long inLength, Stream outstream ) : long
instream Stream The stream to decompress. At the end of this method, the position /// of this stream is directly after the compressed data.
inLength long The length of the input data. Not necessarily all of the /// input data may be read (if there is padding, for example), however never more than /// this number of bytes is read from the input stream.
outstream Stream The stream to write the decompressed data to.
리턴 long

Decompress() 공개 메소드

Decompresses the given file, writing the deocmpressed data to the given output file. The output file will be overwritten if it already exists. Assumes Supports(infile) returns true.
public Decompress ( string infile, string outfile ) : void
infile string The file to decompress.
outfile string The target location of the decompressed file.
리턴 void

ParseCompressionOptions() 공개 메소드

Parses any input specific for this format. Does nothing by default.
public ParseCompressionOptions ( string args ) : int
args string Any arguments that may be used by the format.
리턴 int

Supports() 공개 추상적인 메소드

Checks if the decompressor for this format supports the data from the given stream. Returns false when it is certain that the given data is not supported. False positives may occur, as this method should not do any decompression, and may mis-interpret a similar data format as compressed.
public abstract Supports ( Stream stream, long inLength ) : bool
stream Stream The stream that may or may not contain compressed data. The /// position of this stream may change during this call, but will be returned to its /// original position when the method returns.
inLength long The length of the input stream.
리턴 bool

Supports() 공개 메소드

Checks if the decompressor for this format supports the given file. Assumes the file exists. Returns false when it is certain that the given file is not supported. False positives may occur, as this method should not do any decompression, and may mis-interpret a similar file format as compressed.
public Supports ( string file ) : bool
file string The name of the file to check.
리턴 bool