本文整理汇总了C#中System.IO.Stream类的典型用法代码示例。如果您正苦于以下问题:C# System.IO.Stream类的具体用法?C# System.IO.Stream怎么用?C# System.IO.Stream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
System.IO.Stream类属于命名空间,在下文中一共展示了System.IO.Stream类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SignatureReadingStream
public SignatureReadingStream(System.IO.Stream stream, System.Security.Cryptography.RSACryptoServiceProvider key)
{
if (!VerifySignature(stream, key))
throw new System.IO.InvalidDataException("Unable to verify signature");
m_stream = stream;
this.Position = 0;
}
开发者ID:HITSUN2015,项目名称:duplicati,代码行数:7,代码来源:SignatureReadingStream.cs
示例2: ZOutputStream
public ZOutputStream(System.IO.Stream out_Renamed, int level):base()
{
InitBlock();
this.out_Renamed = out_Renamed;
z.deflateInit(level);
compress = true;
}
开发者ID:yonglehou,项目名称:Pomelo.Data.MySql,代码行数:7,代码来源:ZOutputStream.cs
示例3: OpenedFile
public OpenedFile(String path)
{
baseStream = new System.IO.FileStream(path, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read);
filePath = path;
overlay = new Dictionary<Int64, byte[]>();
fileLength = baseStream.Length;
}
开发者ID:CoryBR,项目名称:OverlayFS,代码行数:7,代码来源:OpenedFile.cs
示例4: HTML
/// <summary>
/// Constructor
/// </summary>
/// <param name="p_Mode"></param>
/// <param name="p_ImageFullPath">The path to write embedded images files</param>
/// <param name="p_ImageRelativePath">The path used in the HTML source. If you save the images in the same path of the HTML file you can leave this path empty.</param>
/// <param name="p_HtmlStream">The stream to write</param>
public HTML(ExportHTMLMode p_Mode, string p_ImageFullPath , string p_ImageRelativePath, System.IO.Stream p_HtmlStream)
{
m_Mode = p_Mode;
m_Stream = p_HtmlStream;
m_ImageFullPath = p_ImageFullPath;
m_ImageRelativePath = p_ImageRelativePath;
}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:14,代码来源:HTML.cs
示例5: ProgressStream
public ProgressStream(System.IO.Stream file)
{
this.file = file;
length = file.Length;
bytesRead = 0;
if (ProgressChanged != null) ProgressChanged(this, new ProgressChangedEventArgs(bytesRead, length));
}
开发者ID:sergiosorias,项目名称:terminalzero,代码行数:7,代码来源:FileStreamProgress.cs
示例6: Init
public void Init(System.IO.Stream stream) {
m_Stream = stream;
m_ProcessedSize = 0;
m_Limit = 0;
m_Pos = 0;
m_StreamWasExhausted = false;
}
开发者ID:debop,项目名称:NFramework,代码行数:7,代码来源:InBuffer.cs
示例7: ReadableDataStorageOnStream
public ReadableDataStorageOnStream(System.IO.Stream stream, bool ownsStream)
{
if (stream == null)
throw new System.ArgumentNullException(nameof(stream));
_stream = stream;
_ownsStream = ownsStream;
}
开发者ID:Rhombulus,项目名称:Mime,代码行数:7,代码来源:ReadableDataStorageOnStream.cs
示例8: ZipCipherStream
/// <summary>
/// The constructor.
/// </summary>
/// <param name="s">The underlying stream</param>
/// <param name="mode">To either encrypt or decrypt.</param>
/// <param name="cipher">The pre-initialized ZipCrypto object.</param>
public ZipCipherStream(System.IO.Stream s, ZipCrypto cipher, CryptoMode mode)
: base()
{
_cipher = cipher;
_s = s;
_mode = mode;
}
开发者ID:ChaotixBluix,项目名称:framework,代码行数:13,代码来源:ZipCrypto.cs
示例9: InputStreamSource
public InputStreamSource(System.IO.Stream in_Renamed)
{
if (in_Renamed == null)
throw new System.NullReferenceException("in");
this.in_Renamed = in_Renamed;
}
开发者ID:BackupTheBerlios,项目名称:tamjb,代码行数:7,代码来源:InputStreamSource.cs
示例10: Backup
/// <summary>
/// Adds a file to the archive
/// </summary>
/// <param name="entry">
/// The backup metadata for the file
/// </param>
/// <param name="stream">
/// The file stream to add to the archive
/// </param>
public void Backup(Backup.Entry entry, Stream stream)
{
// if we are not currently uploading a vault archive,
// then attach a new uploader and create a blob for it
if (this.uploader == null)
{
this.uploader = new GlacierUploader(
this.archive.Glacier,
this.archive.Vault
);
this.archive.BackupIndex.InsertBlob(
new Backup.Blob()
{
Name = this.uploader.UploadID
}
);
}
// fetch the upload blob and sync it with the uploader's offset
var blob = this.archive.BackupIndex.LookupBlob(this.uploader.UploadID);
if (blob.Length != this.uploader.Length)
blob.Length = this.uploader.Resync(blob.Length);
// upload the incoming stream and update the backup entry
var offset = this.uploader.Length;
var length = this.uploader.Upload(stream);
entry.Blob = blob;
entry.Offset = offset;
entry.Length = length;
}
开发者ID:bspell1,项目名称:SkyFloe,代码行数:37,代码来源:GlacierBackup.cs
示例11: init
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: static void init(boolean ignoreCase, String affix, String... dictionaries) throws java.io.IOException, java.text.ParseException
internal static void init(bool ignoreCase, string affix, params string[] dictionaries)
{
if (dictionaries.Length == 0)
{
throw new System.ArgumentException("there must be at least one dictionary");
}
System.IO.Stream affixStream = typeof(StemmerTestBase).getResourceAsStream(affix);
if (affixStream == null)
{
throw new FileNotFoundException("file not found: " + affix);
}
System.IO.Stream[] dictStreams = new System.IO.Stream[dictionaries.Length];
for (int i = 0; i < dictionaries.Length; i++)
{
dictStreams[i] = typeof(StemmerTestBase).getResourceAsStream(dictionaries[i]);
if (dictStreams[i] == null)
{
throw new FileNotFoundException("file not found: " + dictStreams[i]);
}
}
try
{
Dictionary dictionary = new Dictionary(affixStream, Arrays.asList(dictStreams), ignoreCase);
stemmer = new Stemmer(dictionary);
}
finally
{
IOUtils.closeWhileHandlingException(affixStream);
IOUtils.closeWhileHandlingException(dictStreams);
}
}
开发者ID:WakeflyCBass,项目名称:lucenenet,代码行数:36,代码来源:StemmerTestBase.cs
示例12: BackupReader
public BackupReader(string path)
{
System.IO.FileStream fs = new System.IO.FileStream(path, System.IO.FileMode.Open, System.IO.FileAccess.Read);
fs.ReadByte();
inputStream = fs;
inputStream.Seek(0, System.IO.SeekOrigin.Begin);
}
开发者ID:solutema,项目名称:ultralight,代码行数:7,代码来源:BackupReader.cs
示例13: DelegatingStream
/// <summary>
/// Initializes a new instance of the <see cref="DelegatingStream"/> class from the specified
/// <see cref="Stream"/>.
/// </summary>
/// <param name="underlyingStream">The stream to wrap.</param>
/// <param name="ownsStream">
/// <para><see langword="true"/> if this object owns the wrapped stream, and should dispose
/// of it when this instance is closed or disposed.</para>
/// <para>-or-</para>
/// <para><see langword="false"/> if this object should not dispose of the wrapped stream.</para>
/// <para>The default value is <see langword="true"/>.</para>
/// </param>
/// <exception cref="ArgumentNullException">
/// If <paramref name="underlyingStream"/> is <see langword="null"/>.
/// </exception>
public DelegatingStream(Stream underlyingStream, bool ownsStream)
{
if (underlyingStream == null)
throw new ArgumentNullException("underlyingStream");
_underlyingStream = underlyingStream;
_ownsStream = ownsStream;
}
开发者ID:crowdy,项目名称:OpenStack-ConoHa,代码行数:23,代码来源:DelegatingStream.cs
示例14: openSocket
/*
*
*/
public virtual void openSocket()
{
socket = new System.Net.Sockets.TcpClient(host, port);
socket.LingerState = new System.Net.Sockets.LingerOption(true, 1000);
os = socket.GetStream();
is_Renamed = socket.GetStream();
}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:11,代码来源:NuGenHL7ServerTestHelper.cs
示例15: setOutputStream
/// <summary> Sets the underlying output stream to which messages are written. </summary>
public virtual void setOutputStream(System.IO.Stream out_Renamed)
{
lock (this)
{
myOutputStream = out_Renamed;
myWriter = new System.IO.StreamWriter(getWriter(out_Renamed).BaseStream, getWriter(out_Renamed).Encoding);
}
}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:9,代码来源:NuGenMinLLPWriter.cs
示例16: ProgressStream
/// <summary>
/// Initializes a new instance of the <see cref="ProgressStream"/> class from
/// the specified <see cref="Stream"/> and <see cref="IProgress{T}"/> handler.
/// </summary>
/// <param name="underlyingStream">The stream to wrap.</param>
/// <param name="progress">The handler to report progress updates to.</param>
/// <param name="ownsStream">
/// <para><see langword="true"/> if this object owns the wrapped stream, and should dispose
/// of it when this instance is closed or disposed.</para>
/// <para>-or-</para>
/// <para><see langword="false"/> if this object should not dispose of the wrapped stream.</para>
/// <para>The default value is <see langword="true"/>.</para>
/// </param>
/// <exception cref="ArgumentNullException">
/// If <paramref name="underlyingStream"/> is <see langword="null"/>.
/// <para>-or-</para>
/// <para>If <paramref name="progress"/> is <see langword="null"/>.</para>
/// </exception>
public ProgressStream(Stream underlyingStream, IProgress<long> progress, bool ownsStream)
: base(underlyingStream, ownsStream)
{
if (progress == null)
throw new ArgumentNullException("progress");
_progress = progress;
}
开发者ID:crowdy,项目名称:OpenStack-ConoHa,代码行数:26,代码来源:ProgressStream.cs
示例17: BufferFile
public BufferFile(System.IO.Stream fromfile, int buffersize, long seekStart)
{
this.seekStart = seekStart;
this.fromfile = fromfile;
this.buffersize = buffersize;
this.headersize = HEADERPREFIX.Length + INTSTORAGE + 1; // +version byte+4 bytes for buffersize
this.sanityCheck();
}
开发者ID:anukat2015,项目名称:sones,代码行数:8,代码来源:BufferFile.cs
示例18: Dispose
public void Dispose()
{
if (FileByteStream != null)
{
FileByteStream.Close();
FileByteStream = null;
}
}
开发者ID:solondon,项目名称:VisualStudio2013andNETCookbookCode,代码行数:8,代码来源:IFileTransferLibrary.cs
示例19: JavaInputStreamAdapter
/// <summary>
/// Constructs a new <c>JavaInputStreamAdapter</c> instance
/// with the given stream.
/// </summary>
/// <param name="stream">The stream delegate.</param>
public JavaInputStreamAdapter(Stream stream)
{
if (stream == null)
{
throw new ArgumentNullException("stream");
}
m_stream = stream;
}
开发者ID:plusql,项目名称:hsqldb-snapshot-20160112,代码行数:14,代码来源:JavaInputStreamAdapter.cs
示例20: Init
public void Init(System.IO.Stream stream, bool solid) {
ReleaseStream();
_stream = stream;
if(!solid) {
_streamPos = 0;
_pos = 0;
TrainSize = 0;
}
}
开发者ID:debop,项目名称:NFramework,代码行数:9,代码来源:LzOutWindow.cs
注:本文中的System.IO.Stream类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论