本文整理汇总了C#中IStream.Append方法的典型用法代码示例。如果您正苦于以下问题:C# IStream.Append方法的具体用法?C# IStream.Append怎么用?C# IStream.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStream
的用法示例。
在下文中一共展示了IStream.Append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
private static void Write(IStream stream)
{
try
{
int i = 1;
StrKey k1 = k1 = new StrKey("k1");
while (true)
{
stream.Append(k1, new ByteValue(StreamFactory.GetBytes("k1-value" + i)));
i++;
Console.WriteLine("Written "+i+" values");
if (i %10==0)
stream.Seal(false);
if (isWriting)
System.Threading.Thread.Sleep(1000);
else
break;
}
}
catch(Exception e)
{
Console.WriteLine("Exception in write: "+e);
}
}
示例2: Setup
public void Setup()
{
StreamFactory sf = StreamFactory.Instance;
dfs_str_val = sf.openValueDataStream<StrKey, StrValue>(new FqStreamID("99-2729", "A0", "TestRange"),
new CallerInfo(null, "A0", "A0", 1),
null,
StreamFactory.StreamSecurityType.Plain,
CompressionType.None,
StreamFactory.StreamOp.Write);
keys = new List<IKey>();
for (int i = 0; i < 10; i++)
{
keys.Add(new StrKey("k" + i));
for (int j = 0; j < 100; j++)
{
dfs_str_val.Append(keys[i], new StrValue("k" + i + "_value" + j));
}
// dfs_str_val.Seal(null);
}
// IEnumerable<IDataItem> iterator = dfs_str_val.GetAll(new StrKey("k0"));
// foreach (IDataItem data in iterator)
// Console.WriteLine("data is: " + data.GetTimestamp());
}
示例3: AddPicDataStream
private void AddPicDataStream(string key, byte[] imageBytes)
{
StrKey strKey = new StrKey(key);
ByteValue byteVal = new ByteValue(imageBytes);
try
{
picStream = base.CreateDirStream<StrKey, ByteValue>("H2OAlertsPics", true);
picStream.Append(strKey, byteVal);
// logger.Log("WaterAlert picture has been written to {0}.", picStream.Get(strKey).ToString());
picStream.Close();
}
catch (Exception e)
{
logger.Log("Error while writing images to dir stream: {0}", e.ToString());
}
}