C# 클래스 ICSharpCode.SharpZipLib.Tar.TarBuffer

The TarBuffer class implements the tar archive concept of a buffered input stream. This concept goes back to the days of blocked tape drives and special io devices. In the C# universe, the only real function that this class performs is to ensure that files have the correct "record" size, or other tars will complain.

You should never have a need to access this class directly. TarBuffers are created by Tar IO Streams.

파일 보기 프로젝트 열기: icsharpcode/SharpZipLib 1 사용 예제들

공개 메소드들

메소드 설명
Close ( ) : void

Close the TarBuffer. If this is an output buffer, also flush the current block before closing.

CreateInputTarBuffer ( Stream inputStream ) : TarBuffer

Create TarBuffer for reading with default BlockFactor

CreateInputTarBuffer ( Stream inputStream, int blockFactor ) : TarBuffer

Construct TarBuffer for reading inputStream setting BlockFactor

CreateOutputTarBuffer ( Stream outputStream ) : TarBuffer

Construct TarBuffer for writing with default BlockFactor

CreateOutputTarBuffer ( Stream outputStream, int blockFactor ) : TarBuffer

Construct TarBuffer for writing Tar output to streams.

Initialize ( int archiveBlockFactor ) : void

Initialization common to all constructors.

IsEndOfArchiveBlock ( byte block ) : bool

Determine if an archive block indicates the End of an Archive has been reached. End of archive is indicated by a block that consists entirely of null bytes. All remaining blocks for the record should also be null's However some older tars only do a couple of null blocks (Old GNU tar for one) and also partial records

ReadBlock ( ) : byte[]

Read a block from the input stream.

SkipBlock ( ) : void

Skip over a block on the input stream.

WriteBlock ( byte block ) : void

Write a block of data to the archive.

WriteBlock ( byte buffer, int offset ) : void

Write an archive record to the archive, where the record may be inside of a larger array buffer. The buffer must be "offset plus record size" long.

WriteFinalRecord ( ) : void

WriteFinalRecord writes the current record buffer to output any unwritten data is present.

Any trailing bytes are set to zero which is by definition correct behaviour for the end of a tar stream.

WriteRecord ( ) : void

Write a TarBuffer record to the archive.

보호된 메소드들

메소드 설명
TarBuffer ( ) : System

Construct a default TarBuffer

비공개 메소드들

메소드 설명
GetBlockFactor ( ) : int
GetCurrentBlockNum ( ) : int
GetCurrentRecordNum ( ) : int
GetRecordSize ( ) : int
IsEOFBlock ( byte block ) : bool
ReadRecord ( ) : bool

Read a record from data stream.

메소드 상세

Close() 공개 메소드

Close the TarBuffer. If this is an output buffer, also flush the current block before closing.
public Close ( ) : void
리턴 void

CreateInputTarBuffer() 공개 정적인 메소드

Create TarBuffer for reading with default BlockFactor
public static CreateInputTarBuffer ( Stream inputStream ) : TarBuffer
inputStream Stream Stream to buffer
리턴 TarBuffer

CreateInputTarBuffer() 공개 정적인 메소드

Construct TarBuffer for reading inputStream setting BlockFactor
public static CreateInputTarBuffer ( Stream inputStream, int blockFactor ) : TarBuffer
inputStream Stream Stream to buffer
blockFactor int Blocking factor to apply
리턴 TarBuffer

CreateOutputTarBuffer() 공개 정적인 메소드

Construct TarBuffer for writing with default BlockFactor
public static CreateOutputTarBuffer ( Stream outputStream ) : TarBuffer
outputStream Stream output stream for buffer
리턴 TarBuffer

CreateOutputTarBuffer() 공개 정적인 메소드

Construct TarBuffer for writing Tar output to streams.
public static CreateOutputTarBuffer ( Stream outputStream, int blockFactor ) : TarBuffer
outputStream Stream Output stream to write to.
blockFactor int Blocking factor to apply
리턴 TarBuffer

Initialize() 공개 메소드

Initialization common to all constructors.
public Initialize ( int archiveBlockFactor ) : void
archiveBlockFactor int
리턴 void

IsEndOfArchiveBlock() 공개 정적인 메소드

Determine if an archive block indicates the End of an Archive has been reached. End of archive is indicated by a block that consists entirely of null bytes. All remaining blocks for the record should also be null's However some older tars only do a couple of null blocks (Old GNU tar for one) and also partial records
public static IsEndOfArchiveBlock ( byte block ) : bool
block byte The data block to check.
리턴 bool

ReadBlock() 공개 메소드

Read a block from the input stream.
public ReadBlock ( ) : byte[]
리턴 byte[]

SkipBlock() 공개 메소드

Skip over a block on the input stream.
public SkipBlock ( ) : void
리턴 void

TarBuffer() 보호된 메소드

Construct a default TarBuffer
protected TarBuffer ( ) : System
리턴 System

WriteBlock() 공개 메소드

Write a block of data to the archive.
public WriteBlock ( byte block ) : void
block byte /// The data to write to the archive. ///
리턴 void

WriteBlock() 공개 메소드

Write an archive record to the archive, where the record may be inside of a larger array buffer. The buffer must be "offset plus record size" long.
public WriteBlock ( byte buffer, int offset ) : void
buffer byte /// The buffer containing the record data to write. ///
offset int /// The offset of the record data within buffer. ///
리턴 void

WriteFinalRecord() 공개 메소드

WriteFinalRecord writes the current record buffer to output any unwritten data is present.
Any trailing bytes are set to zero which is by definition correct behaviour for the end of a tar stream.
public WriteFinalRecord ( ) : void
리턴 void

WriteRecord() 공개 메소드

Write a TarBuffer record to the archive.
public WriteRecord ( ) : void
리턴 void