scripts
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace ICSharpCode.SharpZipLib.Tar
|
||||
{
|
||||
// Token: 0x02000032 RID: 50
|
||||
[Serializable]
|
||||
public class InvalidHeaderException : TarException
|
||||
{
|
||||
// Token: 0x06000174 RID: 372 RVA: 0x00009988 File Offset: 0x00008988
|
||||
protected InvalidHeaderException(SerializationInfo information, StreamingContext context)
|
||||
: base(information, context)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000175 RID: 373 RVA: 0x00009992 File Offset: 0x00008992
|
||||
public InvalidHeaderException()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000176 RID: 374 RVA: 0x0000999A File Offset: 0x0000899A
|
||||
public InvalidHeaderException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000177 RID: 375 RVA: 0x000099A3 File Offset: 0x000089A3
|
||||
public InvalidHeaderException(string message, Exception exception)
|
||||
: base(message, exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace ICSharpCode.SharpZipLib.Tar
|
||||
{
|
||||
// Token: 0x02000033 RID: 51
|
||||
// (Invoke) Token: 0x06000179 RID: 377
|
||||
public delegate void ProgressMessageHandler(TarArchive archive, TarEntry entry, string message);
|
||||
}
|
||||
@@ -0,0 +1,689 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace ICSharpCode.SharpZipLib.Tar
|
||||
{
|
||||
// Token: 0x02000034 RID: 52
|
||||
public class TarArchive : IDisposable
|
||||
{
|
||||
// Token: 0x14000001 RID: 1
|
||||
// (add) Token: 0x0600017C RID: 380 RVA: 0x000099AD File Offset: 0x000089AD
|
||||
// (remove) Token: 0x0600017D RID: 381 RVA: 0x000099C6 File Offset: 0x000089C6
|
||||
public event ProgressMessageHandler ProgressMessageEvent;
|
||||
|
||||
// Token: 0x0600017E RID: 382 RVA: 0x000099E0 File Offset: 0x000089E0
|
||||
protected virtual void OnProgressMessageEvent(TarEntry entry, string message)
|
||||
{
|
||||
ProgressMessageHandler progressMessageEvent = this.ProgressMessageEvent;
|
||||
if (progressMessageEvent != null)
|
||||
{
|
||||
progressMessageEvent(this, entry, message);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600017F RID: 383 RVA: 0x00009A00 File Offset: 0x00008A00
|
||||
protected TarArchive()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000180 RID: 384 RVA: 0x00009A1E File Offset: 0x00008A1E
|
||||
protected TarArchive(TarInputStream stream)
|
||||
{
|
||||
if (stream == null)
|
||||
{
|
||||
throw new ArgumentNullException("stream");
|
||||
}
|
||||
this.tarIn = stream;
|
||||
}
|
||||
|
||||
// Token: 0x06000181 RID: 385 RVA: 0x00009A51 File Offset: 0x00008A51
|
||||
protected TarArchive(TarOutputStream stream)
|
||||
{
|
||||
if (stream == null)
|
||||
{
|
||||
throw new ArgumentNullException("stream");
|
||||
}
|
||||
this.tarOut = stream;
|
||||
}
|
||||
|
||||
// Token: 0x06000182 RID: 386 RVA: 0x00009A84 File Offset: 0x00008A84
|
||||
public static TarArchive CreateInputTarArchive(Stream inputStream)
|
||||
{
|
||||
if (inputStream == null)
|
||||
{
|
||||
throw new ArgumentNullException("inputStream");
|
||||
}
|
||||
TarInputStream tarInputStream = inputStream as TarInputStream;
|
||||
TarArchive tarArchive;
|
||||
if (tarInputStream != null)
|
||||
{
|
||||
tarArchive = new TarArchive(tarInputStream);
|
||||
}
|
||||
else
|
||||
{
|
||||
tarArchive = TarArchive.CreateInputTarArchive(inputStream, 20);
|
||||
}
|
||||
return tarArchive;
|
||||
}
|
||||
|
||||
// Token: 0x06000183 RID: 387 RVA: 0x00009ABC File Offset: 0x00008ABC
|
||||
public static TarArchive CreateInputTarArchive(Stream inputStream, int blockFactor)
|
||||
{
|
||||
if (inputStream == null)
|
||||
{
|
||||
throw new ArgumentNullException("inputStream");
|
||||
}
|
||||
if (inputStream is TarInputStream)
|
||||
{
|
||||
throw new ArgumentException("TarInputStream not valid");
|
||||
}
|
||||
return new TarArchive(new TarInputStream(inputStream, blockFactor));
|
||||
}
|
||||
|
||||
// Token: 0x06000184 RID: 388 RVA: 0x00009AEC File Offset: 0x00008AEC
|
||||
public static TarArchive CreateOutputTarArchive(Stream outputStream)
|
||||
{
|
||||
if (outputStream == null)
|
||||
{
|
||||
throw new ArgumentNullException("outputStream");
|
||||
}
|
||||
TarOutputStream tarOutputStream = outputStream as TarOutputStream;
|
||||
TarArchive tarArchive;
|
||||
if (tarOutputStream != null)
|
||||
{
|
||||
tarArchive = new TarArchive(tarOutputStream);
|
||||
}
|
||||
else
|
||||
{
|
||||
tarArchive = TarArchive.CreateOutputTarArchive(outputStream, 20);
|
||||
}
|
||||
return tarArchive;
|
||||
}
|
||||
|
||||
// Token: 0x06000185 RID: 389 RVA: 0x00009B24 File Offset: 0x00008B24
|
||||
public static TarArchive CreateOutputTarArchive(Stream outputStream, int blockFactor)
|
||||
{
|
||||
if (outputStream == null)
|
||||
{
|
||||
throw new ArgumentNullException("outputStream");
|
||||
}
|
||||
if (outputStream is TarOutputStream)
|
||||
{
|
||||
throw new ArgumentException("TarOutputStream is not valid");
|
||||
}
|
||||
return new TarArchive(new TarOutputStream(outputStream, blockFactor));
|
||||
}
|
||||
|
||||
// Token: 0x06000186 RID: 390 RVA: 0x00009B53 File Offset: 0x00008B53
|
||||
public void SetKeepOldFiles(bool keepExistingFiles)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
this.keepOldFiles = keepExistingFiles;
|
||||
}
|
||||
|
||||
// Token: 0x17000049 RID: 73
|
||||
// (get) Token: 0x06000187 RID: 391 RVA: 0x00009B6F File Offset: 0x00008B6F
|
||||
// (set) Token: 0x06000188 RID: 392 RVA: 0x00009B8A File Offset: 0x00008B8A
|
||||
public bool AsciiTranslate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
return this.asciiTranslate;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
this.asciiTranslate = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000189 RID: 393 RVA: 0x00009BA6 File Offset: 0x00008BA6
|
||||
[Obsolete("Use the AsciiTranslate property")]
|
||||
public void SetAsciiTranslation(bool translateAsciiFiles)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
this.asciiTranslate = translateAsciiFiles;
|
||||
}
|
||||
|
||||
// Token: 0x1700004A RID: 74
|
||||
// (get) Token: 0x0600018A RID: 394 RVA: 0x00009BC2 File Offset: 0x00008BC2
|
||||
// (set) Token: 0x0600018B RID: 395 RVA: 0x00009BDD File Offset: 0x00008BDD
|
||||
public string PathPrefix
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
return this.pathPrefix;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
this.pathPrefix = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700004B RID: 75
|
||||
// (get) Token: 0x0600018C RID: 396 RVA: 0x00009BF9 File Offset: 0x00008BF9
|
||||
// (set) Token: 0x0600018D RID: 397 RVA: 0x00009C14 File Offset: 0x00008C14
|
||||
public string RootPath
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
return this.rootPath;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
this.rootPath = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600018E RID: 398 RVA: 0x00009C30 File Offset: 0x00008C30
|
||||
public void SetUserInfo(int userId, string userName, int groupId, string groupName)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
this.userId = userId;
|
||||
this.userName = userName;
|
||||
this.groupId = groupId;
|
||||
this.groupName = groupName;
|
||||
this.applyUserInfoOverrides = true;
|
||||
}
|
||||
|
||||
// Token: 0x1700004C RID: 76
|
||||
// (get) Token: 0x0600018F RID: 399 RVA: 0x00009C69 File Offset: 0x00008C69
|
||||
// (set) Token: 0x06000190 RID: 400 RVA: 0x00009C84 File Offset: 0x00008C84
|
||||
public bool ApplyUserInfoOverrides
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
return this.applyUserInfoOverrides;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
this.applyUserInfoOverrides = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700004D RID: 77
|
||||
// (get) Token: 0x06000191 RID: 401 RVA: 0x00009CA0 File Offset: 0x00008CA0
|
||||
public int UserId
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
return this.userId;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700004E RID: 78
|
||||
// (get) Token: 0x06000192 RID: 402 RVA: 0x00009CBB File Offset: 0x00008CBB
|
||||
public string UserName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
return this.userName;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700004F RID: 79
|
||||
// (get) Token: 0x06000193 RID: 403 RVA: 0x00009CD6 File Offset: 0x00008CD6
|
||||
public int GroupId
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
return this.groupId;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000050 RID: 80
|
||||
// (get) Token: 0x06000194 RID: 404 RVA: 0x00009CF1 File Offset: 0x00008CF1
|
||||
public string GroupName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
return this.groupName;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000051 RID: 81
|
||||
// (get) Token: 0x06000195 RID: 405 RVA: 0x00009D0C File Offset: 0x00008D0C
|
||||
public int RecordSize
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
if (this.tarIn != null)
|
||||
{
|
||||
return this.tarIn.RecordSize;
|
||||
}
|
||||
if (this.tarOut != null)
|
||||
{
|
||||
return this.tarOut.RecordSize;
|
||||
}
|
||||
return 10240;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000052 RID: 82
|
||||
// (set) Token: 0x06000196 RID: 406 RVA: 0x00009D59 File Offset: 0x00008D59
|
||||
public bool IsStreamOwner
|
||||
{
|
||||
set
|
||||
{
|
||||
if (this.tarIn != null)
|
||||
{
|
||||
this.tarIn.IsStreamOwner = value;
|
||||
return;
|
||||
}
|
||||
this.tarOut.IsStreamOwner = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000197 RID: 407 RVA: 0x00009D7C File Offset: 0x00008D7C
|
||||
[Obsolete("Use Close instead")]
|
||||
public void CloseArchive()
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// Token: 0x06000198 RID: 408 RVA: 0x00009D84 File Offset: 0x00008D84
|
||||
public void ListContents()
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
TarEntry nextEntry = this.tarIn.GetNextEntry();
|
||||
if (nextEntry == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
this.OnProgressMessageEvent(nextEntry, null);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000199 RID: 409 RVA: 0x00009DC0 File Offset: 0x00008DC0
|
||||
public void ExtractContents(string destinationDirectory)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
TarEntry nextEntry = this.tarIn.GetNextEntry();
|
||||
if (nextEntry == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
this.ExtractEntry(destinationDirectory, nextEntry);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600019A RID: 410 RVA: 0x00009DFC File Offset: 0x00008DFC
|
||||
private void ExtractEntry(string destDir, TarEntry entry)
|
||||
{
|
||||
this.OnProgressMessageEvent(entry, null);
|
||||
string text = entry.Name;
|
||||
if (Path.IsPathRooted(text))
|
||||
{
|
||||
text = text.Substring(Path.GetPathRoot(text).Length);
|
||||
}
|
||||
text = text.Replace('/', Path.DirectorySeparatorChar);
|
||||
string text2 = Path.Combine(destDir, text);
|
||||
if (entry.IsDirectory)
|
||||
{
|
||||
TarArchive.EnsureDirectoryExists(text2);
|
||||
return;
|
||||
}
|
||||
string directoryName = Path.GetDirectoryName(text2);
|
||||
TarArchive.EnsureDirectoryExists(directoryName);
|
||||
bool flag = true;
|
||||
FileInfo fileInfo = new FileInfo(text2);
|
||||
if (fileInfo.Exists)
|
||||
{
|
||||
if (this.keepOldFiles)
|
||||
{
|
||||
this.OnProgressMessageEvent(entry, "Destination file already exists");
|
||||
flag = false;
|
||||
}
|
||||
else if ((fileInfo.Attributes & FileAttributes.ReadOnly) != (FileAttributes)0)
|
||||
{
|
||||
this.OnProgressMessageEvent(entry, "Destination file already exists, and is read-only");
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
bool flag2 = false;
|
||||
Stream stream = File.Create(text2);
|
||||
if (this.asciiTranslate)
|
||||
{
|
||||
flag2 = !TarArchive.IsBinary(text2);
|
||||
}
|
||||
StreamWriter streamWriter = null;
|
||||
if (flag2)
|
||||
{
|
||||
streamWriter = new StreamWriter(stream);
|
||||
}
|
||||
byte[] array = new byte[32768];
|
||||
for (;;)
|
||||
{
|
||||
int num = this.tarIn.Read(array, 0, array.Length);
|
||||
if (num <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
int num2 = 0;
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
if (array[i] == 10)
|
||||
{
|
||||
string @string = Encoding.ASCII.GetString(array, num2, i - num2);
|
||||
streamWriter.WriteLine(@string);
|
||||
num2 = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stream.Write(array, 0, num);
|
||||
}
|
||||
}
|
||||
if (flag2)
|
||||
{
|
||||
streamWriter.Close();
|
||||
return;
|
||||
}
|
||||
stream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600019B RID: 411 RVA: 0x00009F6C File Offset: 0x00008F6C
|
||||
public void WriteEntry(TarEntry sourceEntry, bool recurse)
|
||||
{
|
||||
if (sourceEntry == null)
|
||||
{
|
||||
throw new ArgumentNullException("sourceEntry");
|
||||
}
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException("TarArchive");
|
||||
}
|
||||
try
|
||||
{
|
||||
if (recurse)
|
||||
{
|
||||
TarHeader.SetValueDefaults(sourceEntry.UserId, sourceEntry.UserName, sourceEntry.GroupId, sourceEntry.GroupName);
|
||||
}
|
||||
this.WriteEntryCore(sourceEntry, recurse);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (recurse)
|
||||
{
|
||||
TarHeader.RestoreSetValues();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600019C RID: 412 RVA: 0x00009FE0 File Offset: 0x00008FE0
|
||||
private void WriteEntryCore(TarEntry sourceEntry, bool recurse)
|
||||
{
|
||||
string text = null;
|
||||
string text2 = sourceEntry.File;
|
||||
TarEntry tarEntry = (TarEntry)sourceEntry.Clone();
|
||||
if (this.applyUserInfoOverrides)
|
||||
{
|
||||
tarEntry.GroupId = this.groupId;
|
||||
tarEntry.GroupName = this.groupName;
|
||||
tarEntry.UserId = this.userId;
|
||||
tarEntry.UserName = this.userName;
|
||||
}
|
||||
this.OnProgressMessageEvent(tarEntry, null);
|
||||
if (this.asciiTranslate && !tarEntry.IsDirectory && !TarArchive.IsBinary(text2))
|
||||
{
|
||||
text = Path.GetTempFileName();
|
||||
using (StreamReader streamReader = File.OpenText(text2))
|
||||
{
|
||||
using (Stream stream = File.Create(text))
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
string text3 = streamReader.ReadLine();
|
||||
if (text3 == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
byte[] bytes = Encoding.ASCII.GetBytes(text3);
|
||||
stream.Write(bytes, 0, bytes.Length);
|
||||
stream.WriteByte(10);
|
||||
}
|
||||
stream.Flush();
|
||||
}
|
||||
}
|
||||
tarEntry.Size = new FileInfo(text).Length;
|
||||
text2 = text;
|
||||
}
|
||||
string text4 = null;
|
||||
if (this.rootPath != null && tarEntry.Name.StartsWith(this.rootPath))
|
||||
{
|
||||
text4 = tarEntry.Name.Substring(this.rootPath.Length + 1);
|
||||
}
|
||||
if (this.pathPrefix != null)
|
||||
{
|
||||
text4 = ((text4 == null) ? (this.pathPrefix + "/" + tarEntry.Name) : (this.pathPrefix + "/" + text4));
|
||||
}
|
||||
if (text4 != null)
|
||||
{
|
||||
tarEntry.Name = text4;
|
||||
}
|
||||
this.tarOut.PutNextEntry(tarEntry);
|
||||
if (tarEntry.IsDirectory)
|
||||
{
|
||||
if (recurse)
|
||||
{
|
||||
TarEntry[] directoryEntries = tarEntry.GetDirectoryEntries();
|
||||
for (int i = 0; i < directoryEntries.Length; i++)
|
||||
{
|
||||
this.WriteEntryCore(directoryEntries[i], recurse);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
using (Stream stream2 = File.OpenRead(text2))
|
||||
{
|
||||
byte[] array = new byte[32768];
|
||||
for (;;)
|
||||
{
|
||||
int num = stream2.Read(array, 0, array.Length);
|
||||
if (num <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
this.tarOut.Write(array, 0, num);
|
||||
}
|
||||
}
|
||||
if (text != null && text.Length > 0)
|
||||
{
|
||||
File.Delete(text);
|
||||
}
|
||||
this.tarOut.CloseEntry();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600019D RID: 413 RVA: 0x0000A228 File Offset: 0x00009228
|
||||
public void Dispose()
|
||||
{
|
||||
this.Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
// Token: 0x0600019E RID: 414 RVA: 0x0000A238 File Offset: 0x00009238
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (!this.isDisposed)
|
||||
{
|
||||
this.isDisposed = true;
|
||||
if (disposing)
|
||||
{
|
||||
if (this.tarOut != null)
|
||||
{
|
||||
this.tarOut.Flush();
|
||||
this.tarOut.Close();
|
||||
}
|
||||
if (this.tarIn != null)
|
||||
{
|
||||
this.tarIn.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600019F RID: 415 RVA: 0x0000A288 File Offset: 0x00009288
|
||||
public virtual void Close()
|
||||
{
|
||||
this.Dispose(true);
|
||||
}
|
||||
|
||||
// Token: 0x060001A0 RID: 416 RVA: 0x0000A294 File Offset: 0x00009294
|
||||
~TarArchive()
|
||||
{
|
||||
this.Dispose(false);
|
||||
}
|
||||
|
||||
// Token: 0x060001A1 RID: 417 RVA: 0x0000A2C4 File Offset: 0x000092C4
|
||||
private static void EnsureDirectoryExists(string directoryName)
|
||||
{
|
||||
if (!Directory.Exists(directoryName))
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(directoryName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new TarException("Exception creating directory '" + directoryName + "', " + ex.Message, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060001A2 RID: 418 RVA: 0x0000A310 File Offset: 0x00009310
|
||||
private static bool IsBinary(string filename)
|
||||
{
|
||||
using (FileStream fileStream = File.OpenRead(filename))
|
||||
{
|
||||
int num = Math.Min(4096, (int)fileStream.Length);
|
||||
byte[] array = new byte[num];
|
||||
int num2 = fileStream.Read(array, 0, num);
|
||||
for (int i = 0; i < num2; i++)
|
||||
{
|
||||
byte b = array[i];
|
||||
if (b < 8 || (b > 13 && b < 32) || b == 255)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x040000E1 RID: 225
|
||||
private bool keepOldFiles;
|
||||
|
||||
// Token: 0x040000E2 RID: 226
|
||||
private bool asciiTranslate;
|
||||
|
||||
// Token: 0x040000E3 RID: 227
|
||||
private int userId;
|
||||
|
||||
// Token: 0x040000E4 RID: 228
|
||||
private string userName = string.Empty;
|
||||
|
||||
// Token: 0x040000E5 RID: 229
|
||||
private int groupId;
|
||||
|
||||
// Token: 0x040000E6 RID: 230
|
||||
private string groupName = string.Empty;
|
||||
|
||||
// Token: 0x040000E7 RID: 231
|
||||
private string rootPath;
|
||||
|
||||
// Token: 0x040000E8 RID: 232
|
||||
private string pathPrefix;
|
||||
|
||||
// Token: 0x040000E9 RID: 233
|
||||
private bool applyUserInfoOverrides;
|
||||
|
||||
// Token: 0x040000EA RID: 234
|
||||
private TarInputStream tarIn;
|
||||
|
||||
// Token: 0x040000EB RID: 235
|
||||
private TarOutputStream tarOut;
|
||||
|
||||
// Token: 0x040000EC RID: 236
|
||||
private bool isDisposed;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,403 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace ICSharpCode.SharpZipLib.Tar
|
||||
{
|
||||
// Token: 0x02000035 RID: 53
|
||||
public class TarBuffer
|
||||
{
|
||||
// Token: 0x17000053 RID: 83
|
||||
// (get) Token: 0x060001A3 RID: 419 RVA: 0x0000A39C File Offset: 0x0000939C
|
||||
public int RecordSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.recordSize;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060001A4 RID: 420 RVA: 0x0000A3A4 File Offset: 0x000093A4
|
||||
[Obsolete("Use RecordSize property instead")]
|
||||
public int GetRecordSize()
|
||||
{
|
||||
return this.recordSize;
|
||||
}
|
||||
|
||||
// Token: 0x17000054 RID: 84
|
||||
// (get) Token: 0x060001A5 RID: 421 RVA: 0x0000A3AC File Offset: 0x000093AC
|
||||
public int BlockFactor
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.blockFactor;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060001A6 RID: 422 RVA: 0x0000A3B4 File Offset: 0x000093B4
|
||||
[Obsolete("Use BlockFactor property instead")]
|
||||
public int GetBlockFactor()
|
||||
{
|
||||
return this.blockFactor;
|
||||
}
|
||||
|
||||
// Token: 0x060001A7 RID: 423 RVA: 0x0000A3BC File Offset: 0x000093BC
|
||||
protected TarBuffer()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x060001A8 RID: 424 RVA: 0x0000A3DE File Offset: 0x000093DE
|
||||
public static TarBuffer CreateInputTarBuffer(Stream inputStream)
|
||||
{
|
||||
if (inputStream == null)
|
||||
{
|
||||
throw new ArgumentNullException("inputStream");
|
||||
}
|
||||
return TarBuffer.CreateInputTarBuffer(inputStream, 20);
|
||||
}
|
||||
|
||||
// Token: 0x060001A9 RID: 425 RVA: 0x0000A3F8 File Offset: 0x000093F8
|
||||
public static TarBuffer CreateInputTarBuffer(Stream inputStream, int blockFactor)
|
||||
{
|
||||
if (inputStream == null)
|
||||
{
|
||||
throw new ArgumentNullException("inputStream");
|
||||
}
|
||||
if (blockFactor <= 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("blockFactor", "Factor cannot be negative");
|
||||
}
|
||||
TarBuffer tarBuffer = new TarBuffer();
|
||||
tarBuffer.inputStream = inputStream;
|
||||
tarBuffer.outputStream = null;
|
||||
tarBuffer.Initialize(blockFactor);
|
||||
return tarBuffer;
|
||||
}
|
||||
|
||||
// Token: 0x060001AA RID: 426 RVA: 0x0000A443 File Offset: 0x00009443
|
||||
public static TarBuffer CreateOutputTarBuffer(Stream outputStream)
|
||||
{
|
||||
if (outputStream == null)
|
||||
{
|
||||
throw new ArgumentNullException("outputStream");
|
||||
}
|
||||
return TarBuffer.CreateOutputTarBuffer(outputStream, 20);
|
||||
}
|
||||
|
||||
// Token: 0x060001AB RID: 427 RVA: 0x0000A45C File Offset: 0x0000945C
|
||||
public static TarBuffer CreateOutputTarBuffer(Stream outputStream, int blockFactor)
|
||||
{
|
||||
if (outputStream == null)
|
||||
{
|
||||
throw new ArgumentNullException("outputStream");
|
||||
}
|
||||
if (blockFactor <= 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("blockFactor", "Factor cannot be negative");
|
||||
}
|
||||
TarBuffer tarBuffer = new TarBuffer();
|
||||
tarBuffer.inputStream = null;
|
||||
tarBuffer.outputStream = outputStream;
|
||||
tarBuffer.Initialize(blockFactor);
|
||||
return tarBuffer;
|
||||
}
|
||||
|
||||
// Token: 0x060001AC RID: 428 RVA: 0x0000A4A8 File Offset: 0x000094A8
|
||||
private void Initialize(int archiveBlockFactor)
|
||||
{
|
||||
this.blockFactor = archiveBlockFactor;
|
||||
this.recordSize = archiveBlockFactor * 512;
|
||||
this.recordBuffer = new byte[this.RecordSize];
|
||||
if (this.inputStream != null)
|
||||
{
|
||||
this.currentRecordIndex = -1;
|
||||
this.currentBlockIndex = this.BlockFactor;
|
||||
return;
|
||||
}
|
||||
this.currentRecordIndex = 0;
|
||||
this.currentBlockIndex = 0;
|
||||
}
|
||||
|
||||
// Token: 0x060001AD RID: 429 RVA: 0x0000A504 File Offset: 0x00009504
|
||||
[Obsolete("Use IsEndOfArchiveBlock instead")]
|
||||
public bool IsEOFBlock(byte[] block)
|
||||
{
|
||||
if (block == null)
|
||||
{
|
||||
throw new ArgumentNullException("block");
|
||||
}
|
||||
if (block.Length != 512)
|
||||
{
|
||||
throw new ArgumentException("block length is invalid");
|
||||
}
|
||||
for (int i = 0; i < 512; i++)
|
||||
{
|
||||
if (block[i] != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x060001AE RID: 430 RVA: 0x0000A54C File Offset: 0x0000954C
|
||||
public static bool IsEndOfArchiveBlock(byte[] block)
|
||||
{
|
||||
if (block == null)
|
||||
{
|
||||
throw new ArgumentNullException("block");
|
||||
}
|
||||
if (block.Length != 512)
|
||||
{
|
||||
throw new ArgumentException("block length is invalid");
|
||||
}
|
||||
for (int i = 0; i < 512; i++)
|
||||
{
|
||||
if (block[i] != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x060001AF RID: 431 RVA: 0x0000A594 File Offset: 0x00009594
|
||||
public void SkipBlock()
|
||||
{
|
||||
if (this.inputStream == null)
|
||||
{
|
||||
throw new TarException("no input stream defined");
|
||||
}
|
||||
if (this.currentBlockIndex >= this.BlockFactor && !this.ReadRecord())
|
||||
{
|
||||
throw new TarException("Failed to read a record");
|
||||
}
|
||||
this.currentBlockIndex++;
|
||||
}
|
||||
|
||||
// Token: 0x060001B0 RID: 432 RVA: 0x0000A5E4 File Offset: 0x000095E4
|
||||
public byte[] ReadBlock()
|
||||
{
|
||||
if (this.inputStream == null)
|
||||
{
|
||||
throw new TarException("TarBuffer.ReadBlock - no input stream defined");
|
||||
}
|
||||
if (this.currentBlockIndex >= this.BlockFactor && !this.ReadRecord())
|
||||
{
|
||||
throw new TarException("Failed to read a record");
|
||||
}
|
||||
byte[] array = new byte[512];
|
||||
Array.Copy(this.recordBuffer, this.currentBlockIndex * 512, array, 0, 512);
|
||||
this.currentBlockIndex++;
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x060001B1 RID: 433 RVA: 0x0000A660 File Offset: 0x00009660
|
||||
private bool ReadRecord()
|
||||
{
|
||||
if (this.inputStream == null)
|
||||
{
|
||||
throw new TarException("no input stream stream defined");
|
||||
}
|
||||
this.currentBlockIndex = 0;
|
||||
int num = 0;
|
||||
long num2;
|
||||
for (int i = this.RecordSize; i > 0; i -= (int)num2)
|
||||
{
|
||||
num2 = (long)this.inputStream.Read(this.recordBuffer, num, i);
|
||||
if (num2 <= 0L)
|
||||
{
|
||||
break;
|
||||
}
|
||||
num += (int)num2;
|
||||
}
|
||||
this.currentRecordIndex++;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x17000055 RID: 85
|
||||
// (get) Token: 0x060001B2 RID: 434 RVA: 0x0000A6C9 File Offset: 0x000096C9
|
||||
public int CurrentBlock
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.currentBlockIndex;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000056 RID: 86
|
||||
// (get) Token: 0x060001B3 RID: 435 RVA: 0x0000A6D1 File Offset: 0x000096D1
|
||||
// (set) Token: 0x060001B4 RID: 436 RVA: 0x0000A6D9 File Offset: 0x000096D9
|
||||
public bool IsStreamOwner
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.isStreamOwner_;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.isStreamOwner_ = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060001B5 RID: 437 RVA: 0x0000A6E2 File Offset: 0x000096E2
|
||||
[Obsolete("Use CurrentBlock property instead")]
|
||||
public int GetCurrentBlockNum()
|
||||
{
|
||||
return this.currentBlockIndex;
|
||||
}
|
||||
|
||||
// Token: 0x17000057 RID: 87
|
||||
// (get) Token: 0x060001B6 RID: 438 RVA: 0x0000A6EA File Offset: 0x000096EA
|
||||
public int CurrentRecord
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.currentRecordIndex;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060001B7 RID: 439 RVA: 0x0000A6F2 File Offset: 0x000096F2
|
||||
[Obsolete("Use CurrentRecord property instead")]
|
||||
public int GetCurrentRecordNum()
|
||||
{
|
||||
return this.currentRecordIndex;
|
||||
}
|
||||
|
||||
// Token: 0x060001B8 RID: 440 RVA: 0x0000A6FC File Offset: 0x000096FC
|
||||
public void WriteBlock(byte[] block)
|
||||
{
|
||||
if (block == null)
|
||||
{
|
||||
throw new ArgumentNullException("block");
|
||||
}
|
||||
if (this.outputStream == null)
|
||||
{
|
||||
throw new TarException("TarBuffer.WriteBlock - no output stream defined");
|
||||
}
|
||||
if (block.Length != 512)
|
||||
{
|
||||
string text = string.Format("TarBuffer.WriteBlock - block to write has length '{0}' which is not the block size of '{1}'", block.Length, 512);
|
||||
throw new TarException(text);
|
||||
}
|
||||
if (this.currentBlockIndex >= this.BlockFactor)
|
||||
{
|
||||
this.WriteRecord();
|
||||
}
|
||||
Array.Copy(block, 0, this.recordBuffer, this.currentBlockIndex * 512, 512);
|
||||
this.currentBlockIndex++;
|
||||
}
|
||||
|
||||
// Token: 0x060001B9 RID: 441 RVA: 0x0000A798 File Offset: 0x00009798
|
||||
public void WriteBlock(byte[] buffer, int offset)
|
||||
{
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
if (this.outputStream == null)
|
||||
{
|
||||
throw new TarException("TarBuffer.WriteBlock - no output stream stream defined");
|
||||
}
|
||||
if (offset < 0 || offset >= buffer.Length)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset");
|
||||
}
|
||||
if (offset + 512 > buffer.Length)
|
||||
{
|
||||
string text = string.Format("TarBuffer.WriteBlock - record has length '{0}' with offset '{1}' which is less than the record size of '{2}'", buffer.Length, offset, this.recordSize);
|
||||
throw new TarException(text);
|
||||
}
|
||||
if (this.currentBlockIndex >= this.BlockFactor)
|
||||
{
|
||||
this.WriteRecord();
|
||||
}
|
||||
Array.Copy(buffer, offset, this.recordBuffer, this.currentBlockIndex * 512, 512);
|
||||
this.currentBlockIndex++;
|
||||
}
|
||||
|
||||
// Token: 0x060001BA RID: 442 RVA: 0x0000A854 File Offset: 0x00009854
|
||||
private void WriteRecord()
|
||||
{
|
||||
if (this.outputStream == null)
|
||||
{
|
||||
throw new TarException("TarBuffer.WriteRecord no output stream defined");
|
||||
}
|
||||
this.outputStream.Write(this.recordBuffer, 0, this.RecordSize);
|
||||
this.outputStream.Flush();
|
||||
this.currentBlockIndex = 0;
|
||||
this.currentRecordIndex++;
|
||||
}
|
||||
|
||||
// Token: 0x060001BB RID: 443 RVA: 0x0000A8AC File Offset: 0x000098AC
|
||||
private void WriteFinalRecord()
|
||||
{
|
||||
if (this.outputStream == null)
|
||||
{
|
||||
throw new TarException("TarBuffer.WriteFinalRecord no output stream defined");
|
||||
}
|
||||
if (this.currentBlockIndex > 0)
|
||||
{
|
||||
int num = this.currentBlockIndex * 512;
|
||||
Array.Clear(this.recordBuffer, num, this.RecordSize - num);
|
||||
this.WriteRecord();
|
||||
}
|
||||
this.outputStream.Flush();
|
||||
}
|
||||
|
||||
// Token: 0x060001BC RID: 444 RVA: 0x0000A908 File Offset: 0x00009908
|
||||
public void Close()
|
||||
{
|
||||
if (this.outputStream != null)
|
||||
{
|
||||
this.WriteFinalRecord();
|
||||
if (this.isStreamOwner_)
|
||||
{
|
||||
this.outputStream.Close();
|
||||
}
|
||||
this.outputStream = null;
|
||||
return;
|
||||
}
|
||||
if (this.inputStream != null)
|
||||
{
|
||||
if (this.isStreamOwner_)
|
||||
{
|
||||
this.inputStream.Close();
|
||||
}
|
||||
this.inputStream = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x040000ED RID: 237
|
||||
public const int BlockSize = 512;
|
||||
|
||||
// Token: 0x040000EE RID: 238
|
||||
public const int DefaultBlockFactor = 20;
|
||||
|
||||
// Token: 0x040000EF RID: 239
|
||||
public const int DefaultRecordSize = 10240;
|
||||
|
||||
// Token: 0x040000F0 RID: 240
|
||||
private Stream inputStream;
|
||||
|
||||
// Token: 0x040000F1 RID: 241
|
||||
private Stream outputStream;
|
||||
|
||||
// Token: 0x040000F2 RID: 242
|
||||
private byte[] recordBuffer;
|
||||
|
||||
// Token: 0x040000F3 RID: 243
|
||||
private int currentBlockIndex;
|
||||
|
||||
// Token: 0x040000F4 RID: 244
|
||||
private int currentRecordIndex;
|
||||
|
||||
// Token: 0x040000F5 RID: 245
|
||||
private int recordSize = 10240;
|
||||
|
||||
// Token: 0x040000F6 RID: 246
|
||||
private int blockFactor = 20;
|
||||
|
||||
// Token: 0x040000F7 RID: 247
|
||||
private bool isStreamOwner_ = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,340 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace ICSharpCode.SharpZipLib.Tar
|
||||
{
|
||||
// Token: 0x02000036 RID: 54
|
||||
public class TarEntry : ICloneable
|
||||
{
|
||||
// Token: 0x060001BD RID: 445 RVA: 0x0000A960 File Offset: 0x00009960
|
||||
private TarEntry()
|
||||
{
|
||||
this.header = new TarHeader();
|
||||
}
|
||||
|
||||
// Token: 0x060001BE RID: 446 RVA: 0x0000A973 File Offset: 0x00009973
|
||||
public TarEntry(byte[] headerBuffer)
|
||||
{
|
||||
this.header = new TarHeader();
|
||||
this.header.ParseBuffer(headerBuffer);
|
||||
}
|
||||
|
||||
// Token: 0x060001BF RID: 447 RVA: 0x0000A992 File Offset: 0x00009992
|
||||
public TarEntry(TarHeader header)
|
||||
{
|
||||
if (header == null)
|
||||
{
|
||||
throw new ArgumentNullException("header");
|
||||
}
|
||||
this.header = (TarHeader)header.Clone();
|
||||
}
|
||||
|
||||
// Token: 0x060001C0 RID: 448 RVA: 0x0000A9BC File Offset: 0x000099BC
|
||||
public object Clone()
|
||||
{
|
||||
return new TarEntry
|
||||
{
|
||||
file = this.file,
|
||||
header = (TarHeader)this.header.Clone(),
|
||||
Name = this.Name
|
||||
};
|
||||
}
|
||||
|
||||
// Token: 0x060001C1 RID: 449 RVA: 0x0000AA00 File Offset: 0x00009A00
|
||||
public static TarEntry CreateTarEntry(string name)
|
||||
{
|
||||
TarEntry tarEntry = new TarEntry();
|
||||
TarEntry.NameTarHeader(tarEntry.header, name);
|
||||
return tarEntry;
|
||||
}
|
||||
|
||||
// Token: 0x060001C2 RID: 450 RVA: 0x0000AA20 File Offset: 0x00009A20
|
||||
public static TarEntry CreateEntryFromFile(string fileName)
|
||||
{
|
||||
TarEntry tarEntry = new TarEntry();
|
||||
tarEntry.GetFileTarHeader(tarEntry.header, fileName);
|
||||
return tarEntry;
|
||||
}
|
||||
|
||||
// Token: 0x060001C3 RID: 451 RVA: 0x0000AA44 File Offset: 0x00009A44
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
TarEntry tarEntry = obj as TarEntry;
|
||||
return tarEntry != null && this.Name.Equals(tarEntry.Name);
|
||||
}
|
||||
|
||||
// Token: 0x060001C4 RID: 452 RVA: 0x0000AA6E File Offset: 0x00009A6E
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return this.Name.GetHashCode();
|
||||
}
|
||||
|
||||
// Token: 0x060001C5 RID: 453 RVA: 0x0000AA7B File Offset: 0x00009A7B
|
||||
public bool IsDescendent(TarEntry toTest)
|
||||
{
|
||||
if (toTest == null)
|
||||
{
|
||||
throw new ArgumentNullException("toTest");
|
||||
}
|
||||
return toTest.Name.StartsWith(this.Name);
|
||||
}
|
||||
|
||||
// Token: 0x17000058 RID: 88
|
||||
// (get) Token: 0x060001C6 RID: 454 RVA: 0x0000AA9C File Offset: 0x00009A9C
|
||||
public TarHeader TarHeader
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.header;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000059 RID: 89
|
||||
// (get) Token: 0x060001C7 RID: 455 RVA: 0x0000AAA4 File Offset: 0x00009AA4
|
||||
// (set) Token: 0x060001C8 RID: 456 RVA: 0x0000AAB1 File Offset: 0x00009AB1
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.header.Name;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.header.Name = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700005A RID: 90
|
||||
// (get) Token: 0x060001C9 RID: 457 RVA: 0x0000AABF File Offset: 0x00009ABF
|
||||
// (set) Token: 0x060001CA RID: 458 RVA: 0x0000AACC File Offset: 0x00009ACC
|
||||
public int UserId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.header.UserId;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.header.UserId = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700005B RID: 91
|
||||
// (get) Token: 0x060001CB RID: 459 RVA: 0x0000AADA File Offset: 0x00009ADA
|
||||
// (set) Token: 0x060001CC RID: 460 RVA: 0x0000AAE7 File Offset: 0x00009AE7
|
||||
public int GroupId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.header.GroupId;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.header.GroupId = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700005C RID: 92
|
||||
// (get) Token: 0x060001CD RID: 461 RVA: 0x0000AAF5 File Offset: 0x00009AF5
|
||||
// (set) Token: 0x060001CE RID: 462 RVA: 0x0000AB02 File Offset: 0x00009B02
|
||||
public string UserName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.header.UserName;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.header.UserName = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700005D RID: 93
|
||||
// (get) Token: 0x060001CF RID: 463 RVA: 0x0000AB10 File Offset: 0x00009B10
|
||||
// (set) Token: 0x060001D0 RID: 464 RVA: 0x0000AB1D File Offset: 0x00009B1D
|
||||
public string GroupName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.header.GroupName;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.header.GroupName = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060001D1 RID: 465 RVA: 0x0000AB2B File Offset: 0x00009B2B
|
||||
public void SetIds(int userId, int groupId)
|
||||
{
|
||||
this.UserId = userId;
|
||||
this.GroupId = groupId;
|
||||
}
|
||||
|
||||
// Token: 0x060001D2 RID: 466 RVA: 0x0000AB3B File Offset: 0x00009B3B
|
||||
public void SetNames(string userName, string groupName)
|
||||
{
|
||||
this.UserName = userName;
|
||||
this.GroupName = groupName;
|
||||
}
|
||||
|
||||
// Token: 0x1700005E RID: 94
|
||||
// (get) Token: 0x060001D3 RID: 467 RVA: 0x0000AB4B File Offset: 0x00009B4B
|
||||
// (set) Token: 0x060001D4 RID: 468 RVA: 0x0000AB58 File Offset: 0x00009B58
|
||||
public DateTime ModTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.header.ModTime;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.header.ModTime = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700005F RID: 95
|
||||
// (get) Token: 0x060001D5 RID: 469 RVA: 0x0000AB66 File Offset: 0x00009B66
|
||||
public string File
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.file;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000060 RID: 96
|
||||
// (get) Token: 0x060001D6 RID: 470 RVA: 0x0000AB6E File Offset: 0x00009B6E
|
||||
// (set) Token: 0x060001D7 RID: 471 RVA: 0x0000AB7B File Offset: 0x00009B7B
|
||||
public long Size
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.header.Size;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.header.Size = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000061 RID: 97
|
||||
// (get) Token: 0x060001D8 RID: 472 RVA: 0x0000AB8C File Offset: 0x00009B8C
|
||||
public bool IsDirectory
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.file != null)
|
||||
{
|
||||
return Directory.Exists(this.file);
|
||||
}
|
||||
return this.header != null && (this.header.TypeFlag == 53 || this.Name.EndsWith("/"));
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060001D9 RID: 473 RVA: 0x0000ABDC File Offset: 0x00009BDC
|
||||
public void GetFileTarHeader(TarHeader header, string file)
|
||||
{
|
||||
if (header == null)
|
||||
{
|
||||
throw new ArgumentNullException("header");
|
||||
}
|
||||
if (file == null)
|
||||
{
|
||||
throw new ArgumentNullException("file");
|
||||
}
|
||||
this.file = file;
|
||||
string text = file;
|
||||
if (text.IndexOf(Environment.CurrentDirectory) == 0)
|
||||
{
|
||||
text = text.Substring(Environment.CurrentDirectory.Length);
|
||||
}
|
||||
text = text.Replace(Path.DirectorySeparatorChar, '/');
|
||||
while (text.StartsWith("/"))
|
||||
{
|
||||
text = text.Substring(1);
|
||||
}
|
||||
header.LinkName = string.Empty;
|
||||
header.Name = text;
|
||||
if (Directory.Exists(file))
|
||||
{
|
||||
header.Mode = 1003;
|
||||
header.TypeFlag = 53;
|
||||
if (header.Name.Length == 0 || header.Name[header.Name.Length - 1] != '/')
|
||||
{
|
||||
header.Name += "/";
|
||||
}
|
||||
header.Size = 0L;
|
||||
}
|
||||
else
|
||||
{
|
||||
header.Mode = 33216;
|
||||
header.TypeFlag = 48;
|
||||
header.Size = new FileInfo(file.Replace('/', Path.DirectorySeparatorChar)).Length;
|
||||
}
|
||||
header.ModTime = global::System.IO.File.GetLastWriteTime(file.Replace('/', Path.DirectorySeparatorChar)).ToUniversalTime();
|
||||
header.DevMajor = 0;
|
||||
header.DevMinor = 0;
|
||||
}
|
||||
|
||||
// Token: 0x060001DA RID: 474 RVA: 0x0000AD28 File Offset: 0x00009D28
|
||||
public TarEntry[] GetDirectoryEntries()
|
||||
{
|
||||
if (this.file == null || !Directory.Exists(this.file))
|
||||
{
|
||||
return new TarEntry[0];
|
||||
}
|
||||
string[] fileSystemEntries = Directory.GetFileSystemEntries(this.file);
|
||||
TarEntry[] array = new TarEntry[fileSystemEntries.Length];
|
||||
for (int i = 0; i < fileSystemEntries.Length; i++)
|
||||
{
|
||||
array[i] = TarEntry.CreateEntryFromFile(fileSystemEntries[i]);
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
// Token: 0x060001DB RID: 475 RVA: 0x0000AD80 File Offset: 0x00009D80
|
||||
public void WriteEntryHeader(byte[] outBuffer)
|
||||
{
|
||||
this.header.WriteHeader(outBuffer);
|
||||
}
|
||||
|
||||
// Token: 0x060001DC RID: 476 RVA: 0x0000AD8E File Offset: 0x00009D8E
|
||||
public static void AdjustEntryName(byte[] buffer, string newName)
|
||||
{
|
||||
TarHeader.GetNameBytes(newName, buffer, 0, 100);
|
||||
}
|
||||
|
||||
// Token: 0x060001DD RID: 477 RVA: 0x0000AD9C File Offset: 0x00009D9C
|
||||
public static void NameTarHeader(TarHeader header, string name)
|
||||
{
|
||||
if (header == null)
|
||||
{
|
||||
throw new ArgumentNullException("header");
|
||||
}
|
||||
if (name == null)
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
bool flag = name.EndsWith("/");
|
||||
header.Name = name;
|
||||
header.Mode = (flag ? 1003 : 33216);
|
||||
header.UserId = 0;
|
||||
header.GroupId = 0;
|
||||
header.Size = 0L;
|
||||
header.ModTime = DateTime.UtcNow;
|
||||
header.TypeFlag = (flag ? 53 : 48);
|
||||
header.LinkName = string.Empty;
|
||||
header.UserName = string.Empty;
|
||||
header.GroupName = string.Empty;
|
||||
header.DevMajor = 0;
|
||||
header.DevMinor = 0;
|
||||
}
|
||||
|
||||
// Token: 0x040000F8 RID: 248
|
||||
private string file;
|
||||
|
||||
// Token: 0x040000F9 RID: 249
|
||||
private TarHeader header;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace ICSharpCode.SharpZipLib.Tar
|
||||
{
|
||||
// Token: 0x02000031 RID: 49
|
||||
[Serializable]
|
||||
public class TarException : SharpZipBaseException
|
||||
{
|
||||
// Token: 0x06000170 RID: 368 RVA: 0x00009963 File Offset: 0x00008963
|
||||
protected TarException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000171 RID: 369 RVA: 0x0000996D File Offset: 0x0000896D
|
||||
public TarException()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000172 RID: 370 RVA: 0x00009975 File Offset: 0x00008975
|
||||
public TarException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000173 RID: 371 RVA: 0x0000997E File Offset: 0x0000897E
|
||||
public TarException(string message, Exception exception)
|
||||
: base(message, exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,855 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace ICSharpCode.SharpZipLib.Tar
|
||||
{
|
||||
// Token: 0x02000037 RID: 55
|
||||
public class TarHeader : ICloneable
|
||||
{
|
||||
// Token: 0x060001DE RID: 478 RVA: 0x0000AE4C File Offset: 0x00009E4C
|
||||
public TarHeader()
|
||||
{
|
||||
this.Magic = "ustar ";
|
||||
this.Version = " ";
|
||||
this.Name = "";
|
||||
this.LinkName = "";
|
||||
this.UserId = TarHeader.defaultUserId;
|
||||
this.GroupId = TarHeader.defaultGroupId;
|
||||
this.UserName = TarHeader.defaultUser;
|
||||
this.GroupName = TarHeader.defaultGroupName;
|
||||
this.Size = 0L;
|
||||
}
|
||||
|
||||
// Token: 0x17000062 RID: 98
|
||||
// (get) Token: 0x060001DF RID: 479 RVA: 0x0000AEBF File Offset: 0x00009EBF
|
||||
// (set) Token: 0x060001E0 RID: 480 RVA: 0x0000AEC7 File Offset: 0x00009EC7
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
this.name = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060001E1 RID: 481 RVA: 0x0000AEDE File Offset: 0x00009EDE
|
||||
[Obsolete("Use the Name property instead", true)]
|
||||
public string GetName()
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
|
||||
// Token: 0x17000063 RID: 99
|
||||
// (get) Token: 0x060001E2 RID: 482 RVA: 0x0000AEE6 File Offset: 0x00009EE6
|
||||
// (set) Token: 0x060001E3 RID: 483 RVA: 0x0000AEEE File Offset: 0x00009EEE
|
||||
public int Mode
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.mode;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.mode = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000064 RID: 100
|
||||
// (get) Token: 0x060001E4 RID: 484 RVA: 0x0000AEF7 File Offset: 0x00009EF7
|
||||
// (set) Token: 0x060001E5 RID: 485 RVA: 0x0000AEFF File Offset: 0x00009EFF
|
||||
public int UserId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.userId;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.userId = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000065 RID: 101
|
||||
// (get) Token: 0x060001E6 RID: 486 RVA: 0x0000AF08 File Offset: 0x00009F08
|
||||
// (set) Token: 0x060001E7 RID: 487 RVA: 0x0000AF10 File Offset: 0x00009F10
|
||||
public int GroupId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.groupId;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.groupId = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000066 RID: 102
|
||||
// (get) Token: 0x060001E8 RID: 488 RVA: 0x0000AF19 File Offset: 0x00009F19
|
||||
// (set) Token: 0x060001E9 RID: 489 RVA: 0x0000AF21 File Offset: 0x00009F21
|
||||
public long Size
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.size;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value < 0L)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value", "Cannot be less than zero");
|
||||
}
|
||||
this.size = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000067 RID: 103
|
||||
// (get) Token: 0x060001EA RID: 490 RVA: 0x0000AF3F File Offset: 0x00009F3F
|
||||
// (set) Token: 0x060001EB RID: 491 RVA: 0x0000AF48 File Offset: 0x00009F48
|
||||
public DateTime ModTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.modTime;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value < TarHeader.dateTime1970)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value", "ModTime cannot be before Jan 1st 1970");
|
||||
}
|
||||
this.modTime = new DateTime(value.Year, value.Month, value.Day, value.Hour, value.Minute, value.Second);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000068 RID: 104
|
||||
// (get) Token: 0x060001EC RID: 492 RVA: 0x0000AFA7 File Offset: 0x00009FA7
|
||||
public int Checksum
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.checksum;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000069 RID: 105
|
||||
// (get) Token: 0x060001ED RID: 493 RVA: 0x0000AFAF File Offset: 0x00009FAF
|
||||
public bool IsChecksumValid
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.isChecksumValid;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700006A RID: 106
|
||||
// (get) Token: 0x060001EE RID: 494 RVA: 0x0000AFB7 File Offset: 0x00009FB7
|
||||
// (set) Token: 0x060001EF RID: 495 RVA: 0x0000AFBF File Offset: 0x00009FBF
|
||||
public byte TypeFlag
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.typeFlag;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.typeFlag = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700006B RID: 107
|
||||
// (get) Token: 0x060001F0 RID: 496 RVA: 0x0000AFC8 File Offset: 0x00009FC8
|
||||
// (set) Token: 0x060001F1 RID: 497 RVA: 0x0000AFD0 File Offset: 0x00009FD0
|
||||
public string LinkName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.linkName;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
this.linkName = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700006C RID: 108
|
||||
// (get) Token: 0x060001F2 RID: 498 RVA: 0x0000AFE7 File Offset: 0x00009FE7
|
||||
// (set) Token: 0x060001F3 RID: 499 RVA: 0x0000AFEF File Offset: 0x00009FEF
|
||||
public string Magic
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.magic;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
this.magic = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700006D RID: 109
|
||||
// (get) Token: 0x060001F4 RID: 500 RVA: 0x0000B006 File Offset: 0x0000A006
|
||||
// (set) Token: 0x060001F5 RID: 501 RVA: 0x0000B00E File Offset: 0x0000A00E
|
||||
public string Version
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.version;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
this.version = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700006E RID: 110
|
||||
// (get) Token: 0x060001F6 RID: 502 RVA: 0x0000B025 File Offset: 0x0000A025
|
||||
// (set) Token: 0x060001F7 RID: 503 RVA: 0x0000B030 File Offset: 0x0000A030
|
||||
public string UserName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.userName;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
this.userName = value.Substring(0, Math.Min(32, value.Length));
|
||||
return;
|
||||
}
|
||||
string text = Environment.UserName;
|
||||
if (text.Length > 32)
|
||||
{
|
||||
text = text.Substring(0, 32);
|
||||
}
|
||||
this.userName = text;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700006F RID: 111
|
||||
// (get) Token: 0x060001F8 RID: 504 RVA: 0x0000B07C File Offset: 0x0000A07C
|
||||
// (set) Token: 0x060001F9 RID: 505 RVA: 0x0000B084 File Offset: 0x0000A084
|
||||
public string GroupName
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.groupName;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
this.groupName = "None";
|
||||
return;
|
||||
}
|
||||
this.groupName = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000070 RID: 112
|
||||
// (get) Token: 0x060001FA RID: 506 RVA: 0x0000B09C File Offset: 0x0000A09C
|
||||
// (set) Token: 0x060001FB RID: 507 RVA: 0x0000B0A4 File Offset: 0x0000A0A4
|
||||
public int DevMajor
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.devMajor;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.devMajor = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000071 RID: 113
|
||||
// (get) Token: 0x060001FC RID: 508 RVA: 0x0000B0AD File Offset: 0x0000A0AD
|
||||
// (set) Token: 0x060001FD RID: 509 RVA: 0x0000B0B5 File Offset: 0x0000A0B5
|
||||
public int DevMinor
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.devMinor;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.devMinor = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060001FE RID: 510 RVA: 0x0000B0BE File Offset: 0x0000A0BE
|
||||
public object Clone()
|
||||
{
|
||||
return base.MemberwiseClone();
|
||||
}
|
||||
|
||||
// Token: 0x060001FF RID: 511 RVA: 0x0000B0C8 File Offset: 0x0000A0C8
|
||||
public void ParseBuffer(byte[] header)
|
||||
{
|
||||
if (header == null)
|
||||
{
|
||||
throw new ArgumentNullException("header");
|
||||
}
|
||||
int num = 0;
|
||||
this.name = TarHeader.ParseName(header, num, 100).ToString();
|
||||
num += 100;
|
||||
this.mode = (int)TarHeader.ParseOctal(header, num, 8);
|
||||
num += 8;
|
||||
this.UserId = (int)TarHeader.ParseOctal(header, num, 8);
|
||||
num += 8;
|
||||
this.GroupId = (int)TarHeader.ParseOctal(header, num, 8);
|
||||
num += 8;
|
||||
this.Size = TarHeader.ParseOctal(header, num, 12);
|
||||
num += 12;
|
||||
this.ModTime = TarHeader.GetDateTimeFromCTime(TarHeader.ParseOctal(header, num, 12));
|
||||
num += 12;
|
||||
this.checksum = (int)TarHeader.ParseOctal(header, num, 8);
|
||||
num += 8;
|
||||
this.TypeFlag = header[num++];
|
||||
this.LinkName = TarHeader.ParseName(header, num, 100).ToString();
|
||||
num += 100;
|
||||
this.Magic = TarHeader.ParseName(header, num, 6).ToString();
|
||||
num += 6;
|
||||
this.Version = TarHeader.ParseName(header, num, 2).ToString();
|
||||
num += 2;
|
||||
this.UserName = TarHeader.ParseName(header, num, 32).ToString();
|
||||
num += 32;
|
||||
this.GroupName = TarHeader.ParseName(header, num, 32).ToString();
|
||||
num += 32;
|
||||
this.DevMajor = (int)TarHeader.ParseOctal(header, num, 8);
|
||||
num += 8;
|
||||
this.DevMinor = (int)TarHeader.ParseOctal(header, num, 8);
|
||||
this.isChecksumValid = this.Checksum == TarHeader.MakeCheckSum(header);
|
||||
}
|
||||
|
||||
// Token: 0x06000200 RID: 512 RVA: 0x0000B234 File Offset: 0x0000A234
|
||||
public void WriteHeader(byte[] outBuffer)
|
||||
{
|
||||
if (outBuffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("outBuffer");
|
||||
}
|
||||
int i = 0;
|
||||
i = TarHeader.GetNameBytes(this.Name, outBuffer, i, 100);
|
||||
i = TarHeader.GetOctalBytes((long)this.mode, outBuffer, i, 8);
|
||||
i = TarHeader.GetOctalBytes((long)this.UserId, outBuffer, i, 8);
|
||||
i = TarHeader.GetOctalBytes((long)this.GroupId, outBuffer, i, 8);
|
||||
i = TarHeader.GetLongOctalBytes(this.Size, outBuffer, i, 12);
|
||||
i = TarHeader.GetLongOctalBytes((long)TarHeader.GetCTime(this.ModTime), outBuffer, i, 12);
|
||||
int num = i;
|
||||
for (int j = 0; j < 8; j++)
|
||||
{
|
||||
outBuffer[i++] = 32;
|
||||
}
|
||||
outBuffer[i++] = this.TypeFlag;
|
||||
i = TarHeader.GetNameBytes(this.LinkName, outBuffer, i, 100);
|
||||
i = TarHeader.GetAsciiBytes(this.Magic, 0, outBuffer, i, 6);
|
||||
i = TarHeader.GetNameBytes(this.Version, outBuffer, i, 2);
|
||||
i = TarHeader.GetNameBytes(this.UserName, outBuffer, i, 32);
|
||||
i = TarHeader.GetNameBytes(this.GroupName, outBuffer, i, 32);
|
||||
if (this.TypeFlag == 51 || this.TypeFlag == 52)
|
||||
{
|
||||
i = TarHeader.GetOctalBytes((long)this.DevMajor, outBuffer, i, 8);
|
||||
i = TarHeader.GetOctalBytes((long)this.DevMinor, outBuffer, i, 8);
|
||||
}
|
||||
while (i < outBuffer.Length)
|
||||
{
|
||||
outBuffer[i++] = 0;
|
||||
}
|
||||
this.checksum = TarHeader.ComputeCheckSum(outBuffer);
|
||||
TarHeader.GetCheckSumOctalBytes((long)this.checksum, outBuffer, num, 8);
|
||||
this.isChecksumValid = true;
|
||||
}
|
||||
|
||||
// Token: 0x06000201 RID: 513 RVA: 0x0000B391 File Offset: 0x0000A391
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return this.Name.GetHashCode();
|
||||
}
|
||||
|
||||
// Token: 0x06000202 RID: 514 RVA: 0x0000B3A0 File Offset: 0x0000A3A0
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
TarHeader tarHeader = obj as TarHeader;
|
||||
return tarHeader != null && (this.name == tarHeader.name && this.mode == tarHeader.mode && this.UserId == tarHeader.UserId && this.GroupId == tarHeader.GroupId && this.Size == tarHeader.Size && this.ModTime == tarHeader.ModTime && this.Checksum == tarHeader.Checksum && this.TypeFlag == tarHeader.TypeFlag && this.LinkName == tarHeader.LinkName && this.Magic == tarHeader.Magic && this.Version == tarHeader.Version && this.UserName == tarHeader.UserName && this.GroupName == tarHeader.GroupName && this.DevMajor == tarHeader.DevMajor) && this.DevMinor == tarHeader.DevMinor;
|
||||
}
|
||||
|
||||
// Token: 0x06000203 RID: 515 RVA: 0x0000B4CD File Offset: 0x0000A4CD
|
||||
internal static void SetValueDefaults(int userId, string userName, int groupId, string groupName)
|
||||
{
|
||||
TarHeader.userIdAsSet = userId;
|
||||
TarHeader.defaultUserId = userId;
|
||||
TarHeader.userNameAsSet = userName;
|
||||
TarHeader.defaultUser = userName;
|
||||
TarHeader.groupIdAsSet = groupId;
|
||||
TarHeader.defaultGroupId = groupId;
|
||||
TarHeader.groupNameAsSet = groupName;
|
||||
TarHeader.defaultGroupName = groupName;
|
||||
}
|
||||
|
||||
// Token: 0x06000204 RID: 516 RVA: 0x0000B4FF File Offset: 0x0000A4FF
|
||||
internal static void RestoreSetValues()
|
||||
{
|
||||
TarHeader.defaultUserId = TarHeader.userIdAsSet;
|
||||
TarHeader.defaultUser = TarHeader.userNameAsSet;
|
||||
TarHeader.defaultGroupId = TarHeader.groupIdAsSet;
|
||||
TarHeader.defaultGroupName = TarHeader.groupNameAsSet;
|
||||
}
|
||||
|
||||
// Token: 0x06000205 RID: 517 RVA: 0x0000B52C File Offset: 0x0000A52C
|
||||
public static long ParseOctal(byte[] header, int offset, int length)
|
||||
{
|
||||
if (header == null)
|
||||
{
|
||||
throw new ArgumentNullException("header");
|
||||
}
|
||||
long num = 0L;
|
||||
bool flag = true;
|
||||
int num2 = offset + length;
|
||||
int num3 = offset;
|
||||
while (num3 < num2 && header[num3] != 0)
|
||||
{
|
||||
if (header[num3] != 32 && header[num3] != 48)
|
||||
{
|
||||
goto IL_38;
|
||||
}
|
||||
if (!flag)
|
||||
{
|
||||
if (header[num3] != 32)
|
||||
{
|
||||
goto IL_38;
|
||||
}
|
||||
break;
|
||||
}
|
||||
IL_46:
|
||||
num3++;
|
||||
continue;
|
||||
IL_38:
|
||||
flag = false;
|
||||
num = (num << 3) + (long)(header[num3] - 48);
|
||||
goto IL_46;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x06000206 RID: 518 RVA: 0x0000B588 File Offset: 0x0000A588
|
||||
public static StringBuilder ParseName(byte[] header, int offset, int length)
|
||||
{
|
||||
if (header == null)
|
||||
{
|
||||
throw new ArgumentNullException("header");
|
||||
}
|
||||
if (offset < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset", "Cannot be less than zero");
|
||||
}
|
||||
if (length < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("length", "Cannot be less than zero");
|
||||
}
|
||||
if (offset + length > header.Length)
|
||||
{
|
||||
throw new ArgumentException("Exceeds header size", "length");
|
||||
}
|
||||
StringBuilder stringBuilder = new StringBuilder(length);
|
||||
int num = offset;
|
||||
while (num < offset + length && header[num] != 0)
|
||||
{
|
||||
stringBuilder.Append((char)header[num]);
|
||||
num++;
|
||||
}
|
||||
return stringBuilder;
|
||||
}
|
||||
|
||||
// Token: 0x06000207 RID: 519 RVA: 0x0000B608 File Offset: 0x0000A608
|
||||
public static int GetNameBytes(StringBuilder name, int nameOffset, byte[] buffer, int bufferOffset, int length)
|
||||
{
|
||||
if (name == null)
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
return TarHeader.GetNameBytes(name.ToString(), nameOffset, buffer, bufferOffset, length);
|
||||
}
|
||||
|
||||
// Token: 0x06000208 RID: 520 RVA: 0x0000B638 File Offset: 0x0000A638
|
||||
public static int GetNameBytes(string name, int nameOffset, byte[] buffer, int bufferOffset, int length)
|
||||
{
|
||||
if (name == null)
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
int i;
|
||||
for (i = 0; i < length - 1; i++)
|
||||
{
|
||||
if (nameOffset + i >= name.Length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
buffer[bufferOffset + i] = (byte)name[nameOffset + i];
|
||||
}
|
||||
while (i < length)
|
||||
{
|
||||
buffer[bufferOffset + i] = 0;
|
||||
i++;
|
||||
}
|
||||
return bufferOffset + length;
|
||||
}
|
||||
|
||||
// Token: 0x06000209 RID: 521 RVA: 0x0000B69F File Offset: 0x0000A69F
|
||||
public static int GetNameBytes(StringBuilder name, byte[] buffer, int offset, int length)
|
||||
{
|
||||
if (name == null)
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
return TarHeader.GetNameBytes(name.ToString(), 0, buffer, offset, length);
|
||||
}
|
||||
|
||||
// Token: 0x0600020A RID: 522 RVA: 0x0000B6CC File Offset: 0x0000A6CC
|
||||
public static int GetNameBytes(string name, byte[] buffer, int offset, int length)
|
||||
{
|
||||
if (name == null)
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
return TarHeader.GetNameBytes(name, 0, buffer, offset, length);
|
||||
}
|
||||
|
||||
// Token: 0x0600020B RID: 523 RVA: 0x0000B6F4 File Offset: 0x0000A6F4
|
||||
public static int GetAsciiBytes(string toAdd, int nameOffset, byte[] buffer, int bufferOffset, int length)
|
||||
{
|
||||
if (toAdd == null)
|
||||
{
|
||||
throw new ArgumentNullException("toAdd");
|
||||
}
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
int num = 0;
|
||||
while (num < length && nameOffset + num < toAdd.Length)
|
||||
{
|
||||
buffer[bufferOffset + num] = (byte)toAdd[nameOffset + num];
|
||||
num++;
|
||||
}
|
||||
return bufferOffset + length;
|
||||
}
|
||||
|
||||
// Token: 0x0600020C RID: 524 RVA: 0x0000B748 File Offset: 0x0000A748
|
||||
public static int GetOctalBytes(long value, byte[] buffer, int offset, int length)
|
||||
{
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
int i = length - 1;
|
||||
buffer[offset + i] = 0;
|
||||
i--;
|
||||
if (value > 0L)
|
||||
{
|
||||
long num = value;
|
||||
while (i >= 0)
|
||||
{
|
||||
if (num <= 0L)
|
||||
{
|
||||
break;
|
||||
}
|
||||
buffer[offset + i] = 48 + (byte)(num & 7L);
|
||||
num >>= 3;
|
||||
i--;
|
||||
}
|
||||
}
|
||||
while (i >= 0)
|
||||
{
|
||||
buffer[offset + i] = 48;
|
||||
i--;
|
||||
}
|
||||
return offset + length;
|
||||
}
|
||||
|
||||
// Token: 0x0600020D RID: 525 RVA: 0x0000B7AD File Offset: 0x0000A7AD
|
||||
public static int GetLongOctalBytes(long value, byte[] buffer, int offset, int length)
|
||||
{
|
||||
return TarHeader.GetOctalBytes(value, buffer, offset, length);
|
||||
}
|
||||
|
||||
// Token: 0x0600020E RID: 526 RVA: 0x0000B7B8 File Offset: 0x0000A7B8
|
||||
private static int GetCheckSumOctalBytes(long value, byte[] buffer, int offset, int length)
|
||||
{
|
||||
TarHeader.GetOctalBytes(value, buffer, offset, length - 1);
|
||||
return offset + length;
|
||||
}
|
||||
|
||||
// Token: 0x0600020F RID: 527 RVA: 0x0000B7CC File Offset: 0x0000A7CC
|
||||
private static int ComputeCheckSum(byte[] buffer)
|
||||
{
|
||||
int num = 0;
|
||||
for (int i = 0; i < buffer.Length; i++)
|
||||
{
|
||||
num += (int)buffer[i];
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x06000210 RID: 528 RVA: 0x0000B7F0 File Offset: 0x0000A7F0
|
||||
private static int MakeCheckSum(byte[] buffer)
|
||||
{
|
||||
int num = 0;
|
||||
for (int i = 0; i < 148; i++)
|
||||
{
|
||||
num += (int)buffer[i];
|
||||
}
|
||||
for (int j = 0; j < 8; j++)
|
||||
{
|
||||
num += 32;
|
||||
}
|
||||
for (int k = 156; k < buffer.Length; k++)
|
||||
{
|
||||
num += (int)buffer[k];
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x06000211 RID: 529 RVA: 0x0000B840 File Offset: 0x0000A840
|
||||
private static int GetCTime(DateTime dateTime)
|
||||
{
|
||||
return (int)((dateTime.Ticks - TarHeader.dateTime1970.Ticks) / 10000000L);
|
||||
}
|
||||
|
||||
// Token: 0x06000212 RID: 530 RVA: 0x0000B86C File Offset: 0x0000A86C
|
||||
private static DateTime GetDateTimeFromCTime(long ticks)
|
||||
{
|
||||
DateTime dateTime;
|
||||
try
|
||||
{
|
||||
dateTime = new DateTime(TarHeader.dateTime1970.Ticks + ticks * 10000000L);
|
||||
}
|
||||
catch (ArgumentOutOfRangeException)
|
||||
{
|
||||
dateTime = TarHeader.dateTime1970;
|
||||
}
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
// Token: 0x040000FA RID: 250
|
||||
public const int NAMELEN = 100;
|
||||
|
||||
// Token: 0x040000FB RID: 251
|
||||
public const int MODELEN = 8;
|
||||
|
||||
// Token: 0x040000FC RID: 252
|
||||
public const int UIDLEN = 8;
|
||||
|
||||
// Token: 0x040000FD RID: 253
|
||||
public const int GIDLEN = 8;
|
||||
|
||||
// Token: 0x040000FE RID: 254
|
||||
public const int CHKSUMLEN = 8;
|
||||
|
||||
// Token: 0x040000FF RID: 255
|
||||
public const int CHKSUMOFS = 148;
|
||||
|
||||
// Token: 0x04000100 RID: 256
|
||||
public const int SIZELEN = 12;
|
||||
|
||||
// Token: 0x04000101 RID: 257
|
||||
public const int MAGICLEN = 6;
|
||||
|
||||
// Token: 0x04000102 RID: 258
|
||||
public const int VERSIONLEN = 2;
|
||||
|
||||
// Token: 0x04000103 RID: 259
|
||||
public const int MODTIMELEN = 12;
|
||||
|
||||
// Token: 0x04000104 RID: 260
|
||||
public const int UNAMELEN = 32;
|
||||
|
||||
// Token: 0x04000105 RID: 261
|
||||
public const int GNAMELEN = 32;
|
||||
|
||||
// Token: 0x04000106 RID: 262
|
||||
public const int DEVLEN = 8;
|
||||
|
||||
// Token: 0x04000107 RID: 263
|
||||
public const byte LF_OLDNORM = 0;
|
||||
|
||||
// Token: 0x04000108 RID: 264
|
||||
public const byte LF_NORMAL = 48;
|
||||
|
||||
// Token: 0x04000109 RID: 265
|
||||
public const byte LF_LINK = 49;
|
||||
|
||||
// Token: 0x0400010A RID: 266
|
||||
public const byte LF_SYMLINK = 50;
|
||||
|
||||
// Token: 0x0400010B RID: 267
|
||||
public const byte LF_CHR = 51;
|
||||
|
||||
// Token: 0x0400010C RID: 268
|
||||
public const byte LF_BLK = 52;
|
||||
|
||||
// Token: 0x0400010D RID: 269
|
||||
public const byte LF_DIR = 53;
|
||||
|
||||
// Token: 0x0400010E RID: 270
|
||||
public const byte LF_FIFO = 54;
|
||||
|
||||
// Token: 0x0400010F RID: 271
|
||||
public const byte LF_CONTIG = 55;
|
||||
|
||||
// Token: 0x04000110 RID: 272
|
||||
public const byte LF_GHDR = 103;
|
||||
|
||||
// Token: 0x04000111 RID: 273
|
||||
public const byte LF_XHDR = 120;
|
||||
|
||||
// Token: 0x04000112 RID: 274
|
||||
public const byte LF_ACL = 65;
|
||||
|
||||
// Token: 0x04000113 RID: 275
|
||||
public const byte LF_GNU_DUMPDIR = 68;
|
||||
|
||||
// Token: 0x04000114 RID: 276
|
||||
public const byte LF_EXTATTR = 69;
|
||||
|
||||
// Token: 0x04000115 RID: 277
|
||||
public const byte LF_META = 73;
|
||||
|
||||
// Token: 0x04000116 RID: 278
|
||||
public const byte LF_GNU_LONGLINK = 75;
|
||||
|
||||
// Token: 0x04000117 RID: 279
|
||||
public const byte LF_GNU_LONGNAME = 76;
|
||||
|
||||
// Token: 0x04000118 RID: 280
|
||||
public const byte LF_GNU_MULTIVOL = 77;
|
||||
|
||||
// Token: 0x04000119 RID: 281
|
||||
public const byte LF_GNU_NAMES = 78;
|
||||
|
||||
// Token: 0x0400011A RID: 282
|
||||
public const byte LF_GNU_SPARSE = 83;
|
||||
|
||||
// Token: 0x0400011B RID: 283
|
||||
public const byte LF_GNU_VOLHDR = 86;
|
||||
|
||||
// Token: 0x0400011C RID: 284
|
||||
public const string TMAGIC = "ustar ";
|
||||
|
||||
// Token: 0x0400011D RID: 285
|
||||
public const string GNU_TMAGIC = "ustar ";
|
||||
|
||||
// Token: 0x0400011E RID: 286
|
||||
private const long timeConversionFactor = 10000000L;
|
||||
|
||||
// Token: 0x0400011F RID: 287
|
||||
private static readonly DateTime dateTime1970 = new DateTime(1970, 1, 1, 0, 0, 0, 0);
|
||||
|
||||
// Token: 0x04000120 RID: 288
|
||||
private string name;
|
||||
|
||||
// Token: 0x04000121 RID: 289
|
||||
private int mode;
|
||||
|
||||
// Token: 0x04000122 RID: 290
|
||||
private int userId;
|
||||
|
||||
// Token: 0x04000123 RID: 291
|
||||
private int groupId;
|
||||
|
||||
// Token: 0x04000124 RID: 292
|
||||
private long size;
|
||||
|
||||
// Token: 0x04000125 RID: 293
|
||||
private DateTime modTime;
|
||||
|
||||
// Token: 0x04000126 RID: 294
|
||||
private int checksum;
|
||||
|
||||
// Token: 0x04000127 RID: 295
|
||||
private bool isChecksumValid;
|
||||
|
||||
// Token: 0x04000128 RID: 296
|
||||
private byte typeFlag;
|
||||
|
||||
// Token: 0x04000129 RID: 297
|
||||
private string linkName;
|
||||
|
||||
// Token: 0x0400012A RID: 298
|
||||
private string magic;
|
||||
|
||||
// Token: 0x0400012B RID: 299
|
||||
private string version;
|
||||
|
||||
// Token: 0x0400012C RID: 300
|
||||
private string userName;
|
||||
|
||||
// Token: 0x0400012D RID: 301
|
||||
private string groupName;
|
||||
|
||||
// Token: 0x0400012E RID: 302
|
||||
private int devMajor;
|
||||
|
||||
// Token: 0x0400012F RID: 303
|
||||
private int devMinor;
|
||||
|
||||
// Token: 0x04000130 RID: 304
|
||||
internal static int userIdAsSet;
|
||||
|
||||
// Token: 0x04000131 RID: 305
|
||||
internal static int groupIdAsSet;
|
||||
|
||||
// Token: 0x04000132 RID: 306
|
||||
internal static string userNameAsSet;
|
||||
|
||||
// Token: 0x04000133 RID: 307
|
||||
internal static string groupNameAsSet = "None";
|
||||
|
||||
// Token: 0x04000134 RID: 308
|
||||
internal static int defaultUserId;
|
||||
|
||||
// Token: 0x04000135 RID: 309
|
||||
internal static int defaultGroupId;
|
||||
|
||||
// Token: 0x04000136 RID: 310
|
||||
internal static string defaultGroupName = "None";
|
||||
|
||||
// Token: 0x04000137 RID: 311
|
||||
internal static string defaultUser;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,461 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace ICSharpCode.SharpZipLib.Tar
|
||||
{
|
||||
// Token: 0x02000038 RID: 56
|
||||
public class TarInputStream : Stream
|
||||
{
|
||||
// Token: 0x06000214 RID: 532 RVA: 0x0000B8DF File Offset: 0x0000A8DF
|
||||
public TarInputStream(Stream inputStream)
|
||||
: this(inputStream, 20)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000215 RID: 533 RVA: 0x0000B8EA File Offset: 0x0000A8EA
|
||||
public TarInputStream(Stream inputStream, int blockFactor)
|
||||
{
|
||||
this.inputStream = inputStream;
|
||||
this.tarBuffer = TarBuffer.CreateInputTarBuffer(inputStream, blockFactor);
|
||||
}
|
||||
|
||||
// Token: 0x17000072 RID: 114
|
||||
// (get) Token: 0x06000216 RID: 534 RVA: 0x0000B906 File Offset: 0x0000A906
|
||||
// (set) Token: 0x06000217 RID: 535 RVA: 0x0000B913 File Offset: 0x0000A913
|
||||
public bool IsStreamOwner
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.tarBuffer.IsStreamOwner;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.tarBuffer.IsStreamOwner = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000073 RID: 115
|
||||
// (get) Token: 0x06000218 RID: 536 RVA: 0x0000B921 File Offset: 0x0000A921
|
||||
public override bool CanRead
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.inputStream.CanRead;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000074 RID: 116
|
||||
// (get) Token: 0x06000219 RID: 537 RVA: 0x0000B92E File Offset: 0x0000A92E
|
||||
public override bool CanSeek
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000075 RID: 117
|
||||
// (get) Token: 0x0600021A RID: 538 RVA: 0x0000B931 File Offset: 0x0000A931
|
||||
public override bool CanWrite
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000076 RID: 118
|
||||
// (get) Token: 0x0600021B RID: 539 RVA: 0x0000B934 File Offset: 0x0000A934
|
||||
public override long Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.inputStream.Length;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000077 RID: 119
|
||||
// (get) Token: 0x0600021C RID: 540 RVA: 0x0000B941 File Offset: 0x0000A941
|
||||
// (set) Token: 0x0600021D RID: 541 RVA: 0x0000B94E File Offset: 0x0000A94E
|
||||
public override long Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.inputStream.Position;
|
||||
}
|
||||
set
|
||||
{
|
||||
throw new NotSupportedException("TarInputStream Seek not supported");
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600021E RID: 542 RVA: 0x0000B95A File Offset: 0x0000A95A
|
||||
public override void Flush()
|
||||
{
|
||||
this.inputStream.Flush();
|
||||
}
|
||||
|
||||
// Token: 0x0600021F RID: 543 RVA: 0x0000B967 File Offset: 0x0000A967
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
throw new NotSupportedException("TarInputStream Seek not supported");
|
||||
}
|
||||
|
||||
// Token: 0x06000220 RID: 544 RVA: 0x0000B973 File Offset: 0x0000A973
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
throw new NotSupportedException("TarInputStream SetLength not supported");
|
||||
}
|
||||
|
||||
// Token: 0x06000221 RID: 545 RVA: 0x0000B97F File Offset: 0x0000A97F
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
{
|
||||
throw new NotSupportedException("TarInputStream Write not supported");
|
||||
}
|
||||
|
||||
// Token: 0x06000222 RID: 546 RVA: 0x0000B98B File Offset: 0x0000A98B
|
||||
public override void WriteByte(byte value)
|
||||
{
|
||||
throw new NotSupportedException("TarInputStream WriteByte not supported");
|
||||
}
|
||||
|
||||
// Token: 0x06000223 RID: 547 RVA: 0x0000B998 File Offset: 0x0000A998
|
||||
public override int ReadByte()
|
||||
{
|
||||
byte[] array = new byte[1];
|
||||
int num = this.Read(array, 0, 1);
|
||||
if (num <= 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return (int)array[0];
|
||||
}
|
||||
|
||||
// Token: 0x06000224 RID: 548 RVA: 0x0000B9C0 File Offset: 0x0000A9C0
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
int num = 0;
|
||||
if (this.entryOffset >= this.entrySize)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
long num2 = (long)count;
|
||||
if (num2 + this.entryOffset > this.entrySize)
|
||||
{
|
||||
num2 = this.entrySize - this.entryOffset;
|
||||
}
|
||||
if (this.readBuffer != null)
|
||||
{
|
||||
int num3 = ((num2 > (long)this.readBuffer.Length) ? this.readBuffer.Length : ((int)num2));
|
||||
Array.Copy(this.readBuffer, 0, buffer, offset, num3);
|
||||
if (num3 >= this.readBuffer.Length)
|
||||
{
|
||||
this.readBuffer = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
int num4 = this.readBuffer.Length - num3;
|
||||
byte[] array = new byte[num4];
|
||||
Array.Copy(this.readBuffer, num3, array, 0, num4);
|
||||
this.readBuffer = array;
|
||||
}
|
||||
num += num3;
|
||||
num2 -= (long)num3;
|
||||
offset += num3;
|
||||
}
|
||||
while (num2 > 0L)
|
||||
{
|
||||
byte[] array2 = this.tarBuffer.ReadBlock();
|
||||
if (array2 == null)
|
||||
{
|
||||
throw new TarException("unexpected EOF with " + num2 + " bytes unread");
|
||||
}
|
||||
int num5 = (int)num2;
|
||||
int num6 = array2.Length;
|
||||
if (num6 > num5)
|
||||
{
|
||||
Array.Copy(array2, 0, buffer, offset, num5);
|
||||
this.readBuffer = new byte[num6 - num5];
|
||||
Array.Copy(array2, num5, this.readBuffer, 0, num6 - num5);
|
||||
}
|
||||
else
|
||||
{
|
||||
num5 = num6;
|
||||
Array.Copy(array2, 0, buffer, offset, num6);
|
||||
}
|
||||
num += num5;
|
||||
num2 -= (long)num5;
|
||||
offset += num5;
|
||||
}
|
||||
this.entryOffset += (long)num;
|
||||
return num;
|
||||
}
|
||||
|
||||
// Token: 0x06000225 RID: 549 RVA: 0x0000BB3B File Offset: 0x0000AB3B
|
||||
public override void Close()
|
||||
{
|
||||
this.tarBuffer.Close();
|
||||
}
|
||||
|
||||
// Token: 0x06000226 RID: 550 RVA: 0x0000BB48 File Offset: 0x0000AB48
|
||||
public void SetEntryFactory(TarInputStream.IEntryFactory factory)
|
||||
{
|
||||
this.entryFactory = factory;
|
||||
}
|
||||
|
||||
// Token: 0x17000078 RID: 120
|
||||
// (get) Token: 0x06000227 RID: 551 RVA: 0x0000BB51 File Offset: 0x0000AB51
|
||||
public int RecordSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.tarBuffer.RecordSize;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000228 RID: 552 RVA: 0x0000BB5E File Offset: 0x0000AB5E
|
||||
[Obsolete("Use RecordSize property instead")]
|
||||
public int GetRecordSize()
|
||||
{
|
||||
return this.tarBuffer.RecordSize;
|
||||
}
|
||||
|
||||
// Token: 0x17000079 RID: 121
|
||||
// (get) Token: 0x06000229 RID: 553 RVA: 0x0000BB6B File Offset: 0x0000AB6B
|
||||
public long Available
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.entrySize - this.entryOffset;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600022A RID: 554 RVA: 0x0000BB7C File Offset: 0x0000AB7C
|
||||
public void Skip(long skipCount)
|
||||
{
|
||||
byte[] array = new byte[8192];
|
||||
int num3;
|
||||
for (long num = skipCount; num > 0L; num -= (long)num3)
|
||||
{
|
||||
int num2 = ((num > (long)array.Length) ? array.Length : ((int)num));
|
||||
num3 = this.Read(array, 0, num2);
|
||||
if (num3 == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700007A RID: 122
|
||||
// (get) Token: 0x0600022B RID: 555 RVA: 0x0000BBC0 File Offset: 0x0000ABC0
|
||||
public bool IsMarkSupported
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600022C RID: 556 RVA: 0x0000BBC3 File Offset: 0x0000ABC3
|
||||
public void Mark(int markLimit)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600022D RID: 557 RVA: 0x0000BBC5 File Offset: 0x0000ABC5
|
||||
public void Reset()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x0600022E RID: 558 RVA: 0x0000BBC8 File Offset: 0x0000ABC8
|
||||
public TarEntry GetNextEntry()
|
||||
{
|
||||
if (this.hasHitEOF)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (this.currentEntry != null)
|
||||
{
|
||||
this.SkipToNextEntry();
|
||||
}
|
||||
byte[] array = this.tarBuffer.ReadBlock();
|
||||
if (array == null)
|
||||
{
|
||||
this.hasHitEOF = true;
|
||||
}
|
||||
else if (TarBuffer.IsEndOfArchiveBlock(array))
|
||||
{
|
||||
this.hasHitEOF = true;
|
||||
}
|
||||
if (this.hasHitEOF)
|
||||
{
|
||||
this.currentEntry = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
TarHeader tarHeader = new TarHeader();
|
||||
tarHeader.ParseBuffer(array);
|
||||
if (!tarHeader.IsChecksumValid)
|
||||
{
|
||||
throw new TarException("Header checksum is invalid");
|
||||
}
|
||||
this.entryOffset = 0L;
|
||||
this.entrySize = tarHeader.Size;
|
||||
StringBuilder stringBuilder = null;
|
||||
if (tarHeader.TypeFlag == 76)
|
||||
{
|
||||
byte[] array2 = new byte[512];
|
||||
long num = this.entrySize;
|
||||
stringBuilder = new StringBuilder();
|
||||
while (num > 0L)
|
||||
{
|
||||
int num2 = this.Read(array2, 0, (num > (long)array2.Length) ? array2.Length : ((int)num));
|
||||
if (num2 == -1)
|
||||
{
|
||||
throw new InvalidHeaderException("Failed to read long name entry");
|
||||
}
|
||||
stringBuilder.Append(TarHeader.ParseName(array2, 0, num2).ToString());
|
||||
num -= (long)num2;
|
||||
}
|
||||
this.SkipToNextEntry();
|
||||
array = this.tarBuffer.ReadBlock();
|
||||
}
|
||||
else if (tarHeader.TypeFlag == 103)
|
||||
{
|
||||
this.SkipToNextEntry();
|
||||
array = this.tarBuffer.ReadBlock();
|
||||
}
|
||||
else if (tarHeader.TypeFlag == 120)
|
||||
{
|
||||
this.SkipToNextEntry();
|
||||
array = this.tarBuffer.ReadBlock();
|
||||
}
|
||||
else if (tarHeader.TypeFlag == 86)
|
||||
{
|
||||
this.SkipToNextEntry();
|
||||
array = this.tarBuffer.ReadBlock();
|
||||
}
|
||||
else if (tarHeader.TypeFlag != 48 && tarHeader.TypeFlag != 0 && tarHeader.TypeFlag != 53)
|
||||
{
|
||||
this.SkipToNextEntry();
|
||||
array = this.tarBuffer.ReadBlock();
|
||||
}
|
||||
if (this.entryFactory == null)
|
||||
{
|
||||
this.currentEntry = new TarEntry(array);
|
||||
if (stringBuilder != null)
|
||||
{
|
||||
this.currentEntry.Name = stringBuilder.ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.currentEntry = this.entryFactory.CreateEntry(array);
|
||||
}
|
||||
this.entryOffset = 0L;
|
||||
this.entrySize = this.currentEntry.Size;
|
||||
}
|
||||
catch (InvalidHeaderException ex)
|
||||
{
|
||||
this.entrySize = 0L;
|
||||
this.entryOffset = 0L;
|
||||
this.currentEntry = null;
|
||||
string text = string.Format("Bad header in record {0} block {1} {2}", this.tarBuffer.CurrentRecord, this.tarBuffer.CurrentBlock, ex.Message);
|
||||
throw new InvalidHeaderException(text);
|
||||
}
|
||||
}
|
||||
return this.currentEntry;
|
||||
}
|
||||
|
||||
// Token: 0x0600022F RID: 559 RVA: 0x0000BE3C File Offset: 0x0000AE3C
|
||||
public void CopyEntryContents(Stream outputStream)
|
||||
{
|
||||
byte[] array = new byte[32768];
|
||||
for (;;)
|
||||
{
|
||||
int num = this.Read(array, 0, array.Length);
|
||||
if (num <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
outputStream.Write(array, 0, num);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000230 RID: 560 RVA: 0x0000BE70 File Offset: 0x0000AE70
|
||||
private void SkipToNextEntry()
|
||||
{
|
||||
long num = this.entrySize - this.entryOffset;
|
||||
if (num > 0L)
|
||||
{
|
||||
this.Skip(num);
|
||||
}
|
||||
this.readBuffer = null;
|
||||
}
|
||||
|
||||
// Token: 0x04000138 RID: 312
|
||||
protected bool hasHitEOF;
|
||||
|
||||
// Token: 0x04000139 RID: 313
|
||||
protected long entrySize;
|
||||
|
||||
// Token: 0x0400013A RID: 314
|
||||
protected long entryOffset;
|
||||
|
||||
// Token: 0x0400013B RID: 315
|
||||
protected byte[] readBuffer;
|
||||
|
||||
// Token: 0x0400013C RID: 316
|
||||
protected TarBuffer tarBuffer;
|
||||
|
||||
// Token: 0x0400013D RID: 317
|
||||
private TarEntry currentEntry;
|
||||
|
||||
// Token: 0x0400013E RID: 318
|
||||
protected TarInputStream.IEntryFactory entryFactory;
|
||||
|
||||
// Token: 0x0400013F RID: 319
|
||||
private readonly Stream inputStream;
|
||||
|
||||
// Token: 0x02000039 RID: 57
|
||||
public interface IEntryFactory
|
||||
{
|
||||
// Token: 0x06000231 RID: 561
|
||||
TarEntry CreateEntry(string name);
|
||||
|
||||
// Token: 0x06000232 RID: 562
|
||||
TarEntry CreateEntryFromFile(string fileName);
|
||||
|
||||
// Token: 0x06000233 RID: 563
|
||||
TarEntry CreateEntry(byte[] headerBuffer);
|
||||
}
|
||||
|
||||
// Token: 0x0200003A RID: 58
|
||||
public class EntryFactoryAdapter : TarInputStream.IEntryFactory
|
||||
{
|
||||
// Token: 0x06000234 RID: 564 RVA: 0x0000BE9E File Offset: 0x0000AE9E
|
||||
public TarEntry CreateEntry(string name)
|
||||
{
|
||||
return TarEntry.CreateTarEntry(name);
|
||||
}
|
||||
|
||||
// Token: 0x06000235 RID: 565 RVA: 0x0000BEA6 File Offset: 0x0000AEA6
|
||||
public TarEntry CreateEntryFromFile(string fileName)
|
||||
{
|
||||
return TarEntry.CreateEntryFromFile(fileName);
|
||||
}
|
||||
|
||||
// Token: 0x06000236 RID: 566 RVA: 0x0000BEAE File Offset: 0x0000AEAE
|
||||
public TarEntry CreateEntry(byte[] headerBuffer)
|
||||
{
|
||||
return new TarEntry(headerBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,326 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace ICSharpCode.SharpZipLib.Tar
|
||||
{
|
||||
// Token: 0x0200003B RID: 59
|
||||
public class TarOutputStream : Stream
|
||||
{
|
||||
// Token: 0x06000238 RID: 568 RVA: 0x0000BEBE File Offset: 0x0000AEBE
|
||||
public TarOutputStream(Stream outputStream)
|
||||
: this(outputStream, 20)
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000239 RID: 569 RVA: 0x0000BECC File Offset: 0x0000AECC
|
||||
public TarOutputStream(Stream outputStream, int blockFactor)
|
||||
{
|
||||
if (outputStream == null)
|
||||
{
|
||||
throw new ArgumentNullException("outputStream");
|
||||
}
|
||||
this.outputStream = outputStream;
|
||||
this.buffer = TarBuffer.CreateOutputTarBuffer(outputStream, blockFactor);
|
||||
this.assemblyBuffer = new byte[512];
|
||||
this.blockBuffer = new byte[512];
|
||||
}
|
||||
|
||||
// Token: 0x1700007B RID: 123
|
||||
// (get) Token: 0x0600023A RID: 570 RVA: 0x0000BF21 File Offset: 0x0000AF21
|
||||
// (set) Token: 0x0600023B RID: 571 RVA: 0x0000BF2E File Offset: 0x0000AF2E
|
||||
public bool IsStreamOwner
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.buffer.IsStreamOwner;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.buffer.IsStreamOwner = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700007C RID: 124
|
||||
// (get) Token: 0x0600023C RID: 572 RVA: 0x0000BF3C File Offset: 0x0000AF3C
|
||||
public override bool CanRead
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.outputStream.CanRead;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700007D RID: 125
|
||||
// (get) Token: 0x0600023D RID: 573 RVA: 0x0000BF49 File Offset: 0x0000AF49
|
||||
public override bool CanSeek
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.outputStream.CanSeek;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700007E RID: 126
|
||||
// (get) Token: 0x0600023E RID: 574 RVA: 0x0000BF56 File Offset: 0x0000AF56
|
||||
public override bool CanWrite
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.outputStream.CanWrite;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x1700007F RID: 127
|
||||
// (get) Token: 0x0600023F RID: 575 RVA: 0x0000BF63 File Offset: 0x0000AF63
|
||||
public override long Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.outputStream.Length;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000080 RID: 128
|
||||
// (get) Token: 0x06000240 RID: 576 RVA: 0x0000BF70 File Offset: 0x0000AF70
|
||||
// (set) Token: 0x06000241 RID: 577 RVA: 0x0000BF7D File Offset: 0x0000AF7D
|
||||
public override long Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.outputStream.Position;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.outputStream.Position = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000242 RID: 578 RVA: 0x0000BF8B File Offset: 0x0000AF8B
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
return this.outputStream.Seek(offset, origin);
|
||||
}
|
||||
|
||||
// Token: 0x06000243 RID: 579 RVA: 0x0000BF9A File Offset: 0x0000AF9A
|
||||
public override void SetLength(long value)
|
||||
{
|
||||
this.outputStream.SetLength(value);
|
||||
}
|
||||
|
||||
// Token: 0x06000244 RID: 580 RVA: 0x0000BFA8 File Offset: 0x0000AFA8
|
||||
public override int ReadByte()
|
||||
{
|
||||
return this.outputStream.ReadByte();
|
||||
}
|
||||
|
||||
// Token: 0x06000245 RID: 581 RVA: 0x0000BFB5 File Offset: 0x0000AFB5
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
return this.outputStream.Read(buffer, offset, count);
|
||||
}
|
||||
|
||||
// Token: 0x06000246 RID: 582 RVA: 0x0000BFC5 File Offset: 0x0000AFC5
|
||||
public override void Flush()
|
||||
{
|
||||
this.outputStream.Flush();
|
||||
}
|
||||
|
||||
// Token: 0x06000247 RID: 583 RVA: 0x0000BFD2 File Offset: 0x0000AFD2
|
||||
public void Finish()
|
||||
{
|
||||
if (this.IsEntryOpen)
|
||||
{
|
||||
this.CloseEntry();
|
||||
}
|
||||
this.WriteEofBlock();
|
||||
}
|
||||
|
||||
// Token: 0x06000248 RID: 584 RVA: 0x0000BFE8 File Offset: 0x0000AFE8
|
||||
public override void Close()
|
||||
{
|
||||
if (!this.isClosed)
|
||||
{
|
||||
this.isClosed = true;
|
||||
this.Finish();
|
||||
this.buffer.Close();
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17000081 RID: 129
|
||||
// (get) Token: 0x06000249 RID: 585 RVA: 0x0000C00A File Offset: 0x0000B00A
|
||||
public int RecordSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.buffer.RecordSize;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600024A RID: 586 RVA: 0x0000C017 File Offset: 0x0000B017
|
||||
[Obsolete("Use RecordSize property instead")]
|
||||
public int GetRecordSize()
|
||||
{
|
||||
return this.buffer.RecordSize;
|
||||
}
|
||||
|
||||
// Token: 0x17000082 RID: 130
|
||||
// (get) Token: 0x0600024B RID: 587 RVA: 0x0000C024 File Offset: 0x0000B024
|
||||
private bool IsEntryOpen
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.currBytes < this.currSize;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600024C RID: 588 RVA: 0x0000C034 File Offset: 0x0000B034
|
||||
public void PutNextEntry(TarEntry entry)
|
||||
{
|
||||
if (entry == null)
|
||||
{
|
||||
throw new ArgumentNullException("entry");
|
||||
}
|
||||
if (entry.TarHeader.Name.Length >= 100)
|
||||
{
|
||||
TarHeader tarHeader = new TarHeader();
|
||||
tarHeader.TypeFlag = 76;
|
||||
tarHeader.Name += "././@LongLink";
|
||||
tarHeader.UserId = 0;
|
||||
tarHeader.GroupId = 0;
|
||||
tarHeader.GroupName = "";
|
||||
tarHeader.UserName = "";
|
||||
tarHeader.LinkName = "";
|
||||
tarHeader.Size = (long)entry.TarHeader.Name.Length;
|
||||
tarHeader.WriteHeader(this.blockBuffer);
|
||||
this.buffer.WriteBlock(this.blockBuffer);
|
||||
int i = 0;
|
||||
while (i < entry.TarHeader.Name.Length)
|
||||
{
|
||||
Array.Clear(this.blockBuffer, 0, this.blockBuffer.Length);
|
||||
TarHeader.GetAsciiBytes(entry.TarHeader.Name, i, this.blockBuffer, 0, 512);
|
||||
i += 512;
|
||||
this.buffer.WriteBlock(this.blockBuffer);
|
||||
}
|
||||
}
|
||||
entry.WriteEntryHeader(this.blockBuffer);
|
||||
this.buffer.WriteBlock(this.blockBuffer);
|
||||
this.currBytes = 0L;
|
||||
this.currSize = (entry.IsDirectory ? 0L : entry.Size);
|
||||
}
|
||||
|
||||
// Token: 0x0600024D RID: 589 RVA: 0x0000C18C File Offset: 0x0000B18C
|
||||
public void CloseEntry()
|
||||
{
|
||||
if (this.assemblyBufferLength > 0)
|
||||
{
|
||||
Array.Clear(this.assemblyBuffer, this.assemblyBufferLength, this.assemblyBuffer.Length - this.assemblyBufferLength);
|
||||
this.buffer.WriteBlock(this.assemblyBuffer);
|
||||
this.currBytes += (long)this.assemblyBufferLength;
|
||||
this.assemblyBufferLength = 0;
|
||||
}
|
||||
if (this.currBytes < this.currSize)
|
||||
{
|
||||
string text = string.Format("Entry closed at '{0}' before the '{1}' bytes specified in the header were written", this.currBytes, this.currSize);
|
||||
throw new TarException(text);
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600024E RID: 590 RVA: 0x0000C224 File Offset: 0x0000B224
|
||||
public override void WriteByte(byte value)
|
||||
{
|
||||
this.Write(new byte[] { value }, 0, 1);
|
||||
}
|
||||
|
||||
// Token: 0x0600024F RID: 591 RVA: 0x0000C248 File Offset: 0x0000B248
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
{
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
if (offset < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("offset", "Cannot be negative");
|
||||
}
|
||||
if (buffer.Length - offset < count)
|
||||
{
|
||||
throw new ArgumentException("offset and count combination is invalid");
|
||||
}
|
||||
if (count < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("count", "Cannot be negative");
|
||||
}
|
||||
if (this.currBytes + (long)count > this.currSize)
|
||||
{
|
||||
string text = string.Format("request to write '{0}' bytes exceeds size in header of '{1}' bytes", count, this.currSize);
|
||||
throw new ArgumentOutOfRangeException("count", text);
|
||||
}
|
||||
if (this.assemblyBufferLength > 0)
|
||||
{
|
||||
if (this.assemblyBufferLength + count >= this.blockBuffer.Length)
|
||||
{
|
||||
int num = this.blockBuffer.Length - this.assemblyBufferLength;
|
||||
Array.Copy(this.assemblyBuffer, 0, this.blockBuffer, 0, this.assemblyBufferLength);
|
||||
Array.Copy(buffer, offset, this.blockBuffer, this.assemblyBufferLength, num);
|
||||
this.buffer.WriteBlock(this.blockBuffer);
|
||||
this.currBytes += (long)this.blockBuffer.Length;
|
||||
offset += num;
|
||||
count -= num;
|
||||
this.assemblyBufferLength = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Array.Copy(buffer, offset, this.assemblyBuffer, this.assemblyBufferLength, count);
|
||||
offset += count;
|
||||
this.assemblyBufferLength += count;
|
||||
count -= count;
|
||||
}
|
||||
}
|
||||
while (count > 0)
|
||||
{
|
||||
if (count < this.blockBuffer.Length)
|
||||
{
|
||||
Array.Copy(buffer, offset, this.assemblyBuffer, this.assemblyBufferLength, count);
|
||||
this.assemblyBufferLength += count;
|
||||
return;
|
||||
}
|
||||
this.buffer.WriteBlock(buffer, offset);
|
||||
int num2 = this.blockBuffer.Length;
|
||||
this.currBytes += (long)num2;
|
||||
count -= num2;
|
||||
offset += num2;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06000250 RID: 592 RVA: 0x0000C3FE File Offset: 0x0000B3FE
|
||||
private void WriteEofBlock()
|
||||
{
|
||||
Array.Clear(this.blockBuffer, 0, this.blockBuffer.Length);
|
||||
this.buffer.WriteBlock(this.blockBuffer);
|
||||
}
|
||||
|
||||
// Token: 0x04000140 RID: 320
|
||||
private long currBytes;
|
||||
|
||||
// Token: 0x04000141 RID: 321
|
||||
private int assemblyBufferLength;
|
||||
|
||||
// Token: 0x04000142 RID: 322
|
||||
private bool isClosed;
|
||||
|
||||
// Token: 0x04000143 RID: 323
|
||||
protected long currSize;
|
||||
|
||||
// Token: 0x04000144 RID: 324
|
||||
protected byte[] blockBuffer;
|
||||
|
||||
// Token: 0x04000145 RID: 325
|
||||
protected byte[] assemblyBuffer;
|
||||
|
||||
// Token: 0x04000146 RID: 326
|
||||
protected TarBuffer buffer;
|
||||
|
||||
// Token: 0x04000147 RID: 327
|
||||
protected Stream outputStream;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user