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

The TarInputStream reads a UNIX tar archive as an InputStream. methods are provided to position at each successive entry in the archive, and the read each entry as a normal input stream using read().
상속: Stream
파일 보기 프로젝트 열기: icsharpcode/SharpZipLib 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
entryFactory IEntryFactory
entryOffset long
entrySize long
hasHitEOF bool
readBuffer byte[]
tarBuffer TarBuffer

공개 메소드들

메소드 설명
CopyEntryContents ( Stream outputStream ) : void

Copies the contents of the current tar archive entry directly into an output stream.

Flush ( ) : void

Flushes the baseInputStream

GetNextEntry ( ) : TarEntry

Get the next entry in this tar archive. This will skip over any remaining data in the current entry, if there is one, and place the input stream at the header of the next entry, and read the header and instantiate a new TarEntry from the header bytes and return that entry. If there are no more entries in the archive, null will be returned to indicate that the end of the archive has been reached.

Mark ( int markLimit ) : void

Since we do not support marking just yet, we do nothing.

Read ( byte buffer, int offset, int count ) : int

Reads bytes from the current tar archive entry. This method is aware of the boundaries of the current entry in the archive and will deal with them appropriately

ReadByte ( ) : int

Reads a byte from the current tar archive entry.

Reset ( ) : void

Since we do not support marking just yet, we do nothing.

Seek ( long offset, SeekOrigin origin ) : long

Set the streams position. This operation is not supported and will throw a NotSupportedException

SetEntryFactory ( IEntryFactory factory ) : void

Set the entry factory for this instance.

SetLength ( long value ) : void

Sets the length of the stream This operation is not supported and will throw a NotSupportedException

Skip ( long skipCount ) : void

Skip bytes in the input buffer. This skips bytes in the current entry's data, not the entire archive, and will stop at the end of the current entry's data if the number to skip extends beyond that point.

TarInputStream ( Stream inputStream ) : System

Construct a TarInputStream with default block factor

TarInputStream ( Stream inputStream, int blockFactor ) : System

Construct a TarInputStream with user specified block factor

Write ( byte buffer, int offset, int count ) : void

Writes a block of bytes to this stream using data from a buffer. This operation is not supported and will throw a NotSupportedException

WriteByte ( byte value ) : void

Writes a byte to the current position in the file stream. This operation is not supported and will throw a NotSupportedException

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Closes this stream. Calls the TarBuffer's close() method. The underlying stream is closed by the TarBuffer.

SkipToNextEntry ( ) : void

비공개 메소드들

메소드 설명
GetRecordSize ( ) : int

메소드 상세

CopyEntryContents() 공개 메소드

Copies the contents of the current tar archive entry directly into an output stream.
public CopyEntryContents ( Stream outputStream ) : void
outputStream Stream /// The OutputStream into which to write the entry's data. ///
리턴 void

Dispose() 보호된 메소드

Closes this stream. Calls the TarBuffer's close() method. The underlying stream is closed by the TarBuffer.
protected Dispose ( bool disposing ) : void
disposing bool
리턴 void

Flush() 공개 메소드

Flushes the baseInputStream
public Flush ( ) : void
리턴 void

GetNextEntry() 공개 메소드

Get the next entry in this tar archive. This will skip over any remaining data in the current entry, if there is one, and place the input stream at the header of the next entry, and read the header and instantiate a new TarEntry from the header bytes and return that entry. If there are no more entries in the archive, null will be returned to indicate that the end of the archive has been reached.
public GetNextEntry ( ) : TarEntry
리턴 TarEntry

Mark() 공개 메소드

Since we do not support marking just yet, we do nothing.
public Mark ( int markLimit ) : void
markLimit int /// The limit to mark. ///
리턴 void

Read() 공개 메소드

Reads bytes from the current tar archive entry. This method is aware of the boundaries of the current entry in the archive and will deal with them appropriately
public Read ( byte buffer, int offset, int count ) : int
buffer byte /// The buffer into which to place bytes read. ///
offset int /// The offset at which to place bytes read. ///
count int /// The number of bytes to read. ///
리턴 int

ReadByte() 공개 메소드

Reads a byte from the current tar archive entry.
public ReadByte ( ) : int
리턴 int

Reset() 공개 메소드

Since we do not support marking just yet, we do nothing.
public Reset ( ) : void
리턴 void

Seek() 공개 메소드

Set the streams position. This operation is not supported and will throw a NotSupportedException
Any access
public Seek ( long offset, SeekOrigin origin ) : long
offset long The offset relative to the origin to seek to.
origin SeekOrigin The to start seeking from.
리턴 long

SetEntryFactory() 공개 메소드

Set the entry factory for this instance.
public SetEntryFactory ( IEntryFactory factory ) : void
factory IEntryFactory The factory for creating new entries
리턴 void

SetLength() 공개 메소드

Sets the length of the stream This operation is not supported and will throw a NotSupportedException
Any access
public SetLength ( long value ) : void
value long The new stream length.
리턴 void

Skip() 공개 메소드

Skip bytes in the input buffer. This skips bytes in the current entry's data, not the entire archive, and will stop at the end of the current entry's data if the number to skip extends beyond that point.
public Skip ( long skipCount ) : void
skipCount long /// The number of bytes to skip. ///
리턴 void

SkipToNextEntry() 보호된 메소드

protected SkipToNextEntry ( ) : void
리턴 void

TarInputStream() 공개 메소드

Construct a TarInputStream with default block factor
public TarInputStream ( Stream inputStream ) : System
inputStream Stream stream to source data from
리턴 System

TarInputStream() 공개 메소드

Construct a TarInputStream with user specified block factor
public TarInputStream ( Stream inputStream, int blockFactor ) : System
inputStream Stream stream to source data from
blockFactor int block factor to apply to archive
리턴 System

Write() 공개 메소드

Writes a block of bytes to this stream using data from a buffer. This operation is not supported and will throw a NotSupportedException
Any access
public Write ( byte buffer, int offset, int count ) : void
buffer byte The buffer containing bytes to write.
offset int The offset in the buffer of the frist byte to write.
count int The number of bytes to write.
리턴 void

WriteByte() 공개 메소드

Writes a byte to the current position in the file stream. This operation is not supported and will throw a NotSupportedException
Any access
public WriteByte ( byte value ) : void
value byte The byte value to write.
리턴 void

프로퍼티 상세

entryFactory 보호되어 있는 프로퍼티

Factory used to create TarEntry or descendant class instance
protected IEntryFactory entryFactory
리턴 IEntryFactory

entryOffset 보호되어 있는 프로퍼티

Number of bytes read for this entry so far
protected long entryOffset
리턴 long

entrySize 보호되어 있는 프로퍼티

Size of this entry as recorded in header
protected long entrySize
리턴 long

hasHitEOF 보호되어 있는 프로퍼티

Flag set when last block has been read
protected bool hasHitEOF
리턴 bool

readBuffer 보호되어 있는 프로퍼티

Buffer used with calls to Read()
protected byte[] readBuffer
리턴 byte[]

tarBuffer 보호되어 있는 프로퍼티

Working buffer
protected TarBuffer,ICSharpCode.SharpZipLib.Tar tarBuffer
리턴 TarBuffer