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
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
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