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().
More...
|
| | TarInputStream (Stream inputStream) |
| | Construct a TarInputStream with default block factor.
|
| | TarInputStream (Stream inputStream, int blockFactor) |
| | Construct a TarInputStream with user specified block factor.
|
| override void | Flush () |
| | Flushes the baseInputStream.
|
| override long | Seek (long offset, SeekOrigin origin) |
| | Set the streams position. This operation is not supported and will throw a NotSupportedException.
|
| override void | SetLength (long value) |
| | Sets the length of the stream This operation is not supported and will throw a NotSupportedException.
|
| override void | Write (byte[] buffer, int offset, int count) |
| | Writes a block of bytes to this stream using data from a buffer. This operation is not supported and will throw a NotSupportedException.
|
| override void | WriteByte (byte value) |
| | Writes a byte to the current position in the file stream. This operation is not supported and will throw a NotSupportedException.
|
| override int | ReadByte () |
| | Reads a byte from the current tar archive entry.
|
| override int | Read (byte[] buffer, int offset, int count) |
| | Reads bytes from the current tar archive entry.
|
| override void | Close () |
| | Closes this stream. Calls the TarBuffer's close() method. The underlying stream is closed by the TarBuffer.
|
| void | SetEntryFactory (IEntryFactory factory) |
| | Set the entry factory for this instance.
|
| int | GetRecordSize () |
| | Get the record size being used by this stream's TarBuffer.
|
| void | Skip (long skipCount) |
| | 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.
|
| void | Mark (int markLimit) |
| | Since we do not support marking just yet, we do nothing.
|
| void | Reset () |
| | Since we do not support marking just yet, we do nothing.
|
| TarEntry | 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.
|
| void | CopyEntryContents (Stream outputStream) |
| | Copies the contents of the current tar archive entry directly into an output stream.
|
|
| bool | IsStreamOwner [get, set] |
| | Get/set flag indicating ownership of the underlying stream. When the flag is true Close will close the underlying stream also.
|
| override bool | CanRead [get] |
| | Gets a value indicating whether the current stream supports reading.
|
| override bool | CanSeek [get] |
| | Gets a value indicating whether the current stream supports seeking This property always returns false.
|
| override bool | CanWrite [get] |
| | Gets a value indicating if the stream supports writing. This property always returns false.
|
| override long | Length [get] |
| | The length in bytes of the stream.
|
| override long | Position [get, set] |
| | Gets or sets the position within the stream. Setting the Position is not supported and throws a NotSupportedExceptionNotSupportedException.
|
| int | RecordSize [get] |
| | Get the record size being used by this stream's TarBuffer.
|
| long | Available [get] |
| | Get the available data that can be read from the current entry in the archive. This does not indicate how much data is left in the entire archive, only in the current entry. This value is determined from the entry's size header field and the amount of data already read from the current entry.
|
| bool | IsMarkSupported [get] |
| | Return a value of true if marking is supported; false otherwise.
|
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().
◆ TarInputStream() [1/2]
| ICSharpCode.SharpZipLib.Tar.TarInputStream.TarInputStream |
( |
Stream | inputStream | ) |
|
Construct a TarInputStream with default block factor.
- Parameters
-
| inputStream | stream to source data from |
◆ TarInputStream() [2/2]
| ICSharpCode.SharpZipLib.Tar.TarInputStream.TarInputStream |
( |
Stream | inputStream, |
|
|
int | blockFactor ) |
Construct a TarInputStream with user specified block factor.
- Parameters
-
| inputStream | stream to source data from |
| blockFactor | block factor to apply to archive |
◆ Close()
| override void ICSharpCode.SharpZipLib.Tar.TarInputStream.Close |
( |
| ) |
|
Closes this stream. Calls the TarBuffer's close() method. The underlying stream is closed by the TarBuffer.
◆ CopyEntryContents()
| void ICSharpCode.SharpZipLib.Tar.TarInputStream.CopyEntryContents |
( |
Stream | outputStream | ) |
|
Copies the contents of the current tar archive entry directly into an output stream.
- Parameters
-
| outputStream | The OutputStream into which to write the entry's data. |
◆ Flush()
| override void ICSharpCode.SharpZipLib.Tar.TarInputStream.Flush |
( |
| ) |
|
Flushes the baseInputStream.
◆ GetNextEntry()
| TarEntry ICSharpCode.SharpZipLib.Tar.TarInputStream.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.
- Returns
- The next TarEntry in the archive, or null.
◆ GetRecordSize()
| int ICSharpCode.SharpZipLib.Tar.TarInputStream.GetRecordSize |
( |
| ) |
|
◆ Mark()
| void ICSharpCode.SharpZipLib.Tar.TarInputStream.Mark |
( |
int | markLimit | ) |
|
Since we do not support marking just yet, we do nothing.
- Parameters
-
| markLimit | The limit to mark. |
◆ Read()
| override int ICSharpCode.SharpZipLib.Tar.TarInputStream.Read |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count ) |
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
- Parameters
-
| buffer | The buffer into which to place bytes read. |
| offset | The offset at which to place bytes read. |
| count | The number of bytes to read. |
- Returns
- The number of bytes read, or 0 at end of stream/EOF.
◆ ReadByte()
| override int ICSharpCode.SharpZipLib.Tar.TarInputStream.ReadByte |
( |
| ) |
|
Reads a byte from the current tar archive entry.
- Returns
- A byte cast to an int; -1 if the at the end of the stream.
◆ Reset()
| void ICSharpCode.SharpZipLib.Tar.TarInputStream.Reset |
( |
| ) |
|
Since we do not support marking just yet, we do nothing.
◆ Seek()
| override long ICSharpCode.SharpZipLib.Tar.TarInputStream.Seek |
( |
long | offset, |
|
|
SeekOrigin | origin ) |
Set the streams position. This operation is not supported and will throw a NotSupportedException.
- Parameters
-
| offset | The offset relative to the origin to seek to. |
| origin | The SeekOrigin to start seeking from. |
- Returns
- The new position in the stream.
- Exceptions
-
| NotSupportedException | Any access |
◆ SetEntryFactory()
| void ICSharpCode.SharpZipLib.Tar.TarInputStream.SetEntryFactory |
( |
IEntryFactory | factory | ) |
|
Set the entry factory for this instance.
- Parameters
-
| factory | The factory for creating new entries |
◆ SetLength()
| override void ICSharpCode.SharpZipLib.Tar.TarInputStream.SetLength |
( |
long | value | ) |
|
Sets the length of the stream This operation is not supported and will throw a NotSupportedException.
- Parameters
-
| value | The new stream length. |
- Exceptions
-
| NotSupportedException | Any access |
◆ Skip()
| void ICSharpCode.SharpZipLib.Tar.TarInputStream.Skip |
( |
long | skipCount | ) |
|
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.
- Parameters
-
| skipCount | The number of bytes to skip. |
◆ SkipToNextEntry()
| void ICSharpCode.SharpZipLib.Tar.TarInputStream.SkipToNextEntry |
( |
| ) |
|
|
private |
◆ Write()
| override void ICSharpCode.SharpZipLib.Tar.TarInputStream.Write |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count ) |
Writes a block of bytes to this stream using data from a buffer. This operation is not supported and will throw a NotSupportedException.
- Parameters
-
| buffer | The buffer containing bytes to write. |
| offset | The offset in the buffer of the frist byte to write. |
| count | The number of bytes to write. |
- Exceptions
-
| NotSupportedException | Any access |
◆ WriteByte()
| override void ICSharpCode.SharpZipLib.Tar.TarInputStream.WriteByte |
( |
byte | value | ) |
|
Writes a byte to the current position in the file stream. This operation is not supported and will throw a NotSupportedException.
- Parameters
-
| value | The byte value to write. |
- Exceptions
-
| NotSupportedException | Any access |
◆ currentEntry
| TarEntry ICSharpCode.SharpZipLib.Tar.TarInputStream.currentEntry |
|
private |
Current entry being read.
◆ entryFactory
| IEntryFactory ICSharpCode.SharpZipLib.Tar.TarInputStream.entryFactory |
|
protected |
Factory used to create TarEntry or descendant class instance.
◆ entryOffset
| long ICSharpCode.SharpZipLib.Tar.TarInputStream.entryOffset |
|
protected |
Number of bytes read for this entry so far.
◆ entrySize
| long ICSharpCode.SharpZipLib.Tar.TarInputStream.entrySize |
|
protected |
Size of this entry as recorded in header.
◆ hasHitEOF
| bool ICSharpCode.SharpZipLib.Tar.TarInputStream.hasHitEOF |
|
protected |
Flag set when last block has been read.
◆ inputStream
| readonly Stream ICSharpCode.SharpZipLib.Tar.TarInputStream.inputStream |
|
private |
Stream used as the source of input data.
◆ readBuffer
| byte [] ICSharpCode.SharpZipLib.Tar.TarInputStream.readBuffer |
|
protected |
Buffer used with calls to.
◆ tarBuffer
| TarBuffer ICSharpCode.SharpZipLib.Tar.TarInputStream.tarBuffer |
|
protected |
◆ Available
| long ICSharpCode.SharpZipLib.Tar.TarInputStream.Available |
|
get |
Get the available data that can be read from the current entry in the archive. This does not indicate how much data is left in the entire archive, only in the current entry. This value is determined from the entry's size header field and the amount of data already read from the current entry.
- Returns
- The number of available bytes for the current entry.
◆ CanRead
| override bool ICSharpCode.SharpZipLib.Tar.TarInputStream.CanRead |
|
get |
Gets a value indicating whether the current stream supports reading.
◆ CanSeek
| override bool ICSharpCode.SharpZipLib.Tar.TarInputStream.CanSeek |
|
get |
Gets a value indicating whether the current stream supports seeking This property always returns false.
◆ CanWrite
| override bool ICSharpCode.SharpZipLib.Tar.TarInputStream.CanWrite |
|
get |
Gets a value indicating if the stream supports writing. This property always returns false.
◆ IsMarkSupported
| bool ICSharpCode.SharpZipLib.Tar.TarInputStream.IsMarkSupported |
|
get |
Return a value of true if marking is supported; false otherwise.
Currently marking is not supported, the return value is always false.
◆ IsStreamOwner
| bool ICSharpCode.SharpZipLib.Tar.TarInputStream.IsStreamOwner |
|
getset |
Get/set flag indicating ownership of the underlying stream. When the flag is true Close will close the underlying stream also.
◆ Length
| override long ICSharpCode.SharpZipLib.Tar.TarInputStream.Length |
|
get |
The length in bytes of the stream.
◆ Position
| override long ICSharpCode.SharpZipLib.Tar.TarInputStream.Position |
|
getset |
Gets or sets the position within the stream. Setting the Position is not supported and throws a NotSupportedExceptionNotSupportedException.
- Exceptions
-
| NotSupportedException | Any attempt to set position |
◆ RecordSize
| int ICSharpCode.SharpZipLib.Tar.TarInputStream.RecordSize |
|
get |
Get the record size being used by this stream's TarBuffer.
The documentation for this class was generated from the following file: