本文整理汇总了C#中IReadBuffer类的典型用法代码示例。如果您正苦于以下问题:C# IReadBuffer类的具体用法?C# IReadBuffer怎么用?C# IReadBuffer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IReadBuffer类属于命名空间,在下文中一共展示了IReadBuffer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadTypeInfo
public virtual void ReadTypeInfo(Transaction trans, IReadBuffer buffer, ArrayInfo
info, int classID)
{
BitMap4 typeInfoBitmap = new BitMap4(buffer.ReadByte());
info.Primitive(typeInfoBitmap.IsTrue(0));
info.Nullable(typeInfoBitmap.IsTrue(1));
}
示例2: SeekSecondaryOffset
protected override void SeekSecondaryOffset(IReadBuffer buffer, ITypeHandler4 typeHandler
)
{
if (Handlers4.HandlesPrimitiveArray(typeHandler))
{
buffer.Seek(buffer.ReadInt());
}
}
示例3: ReadLengthAndString
public virtual string ReadLengthAndString(IReadBuffer buffer)
{
int length = buffer.ReadInt();
if (length == 0)
{
return string.Empty;
}
return Read(buffer, length);
}
示例4: DoWithSlotIndirection
public virtual object DoWithSlotIndirection(IReadBuffer buffer, ITypeHandler4 typeHandler
, IClosure4 closure)
{
if (!IsIndirectedWithinSlot(typeHandler))
{
return closure.Run();
}
return DoWithSlotIndirection(buffer, closure);
}
示例5: Read
public virtual string Read(IReadBuffer buffer, int length)
{
char[] chars = new char[length];
for (int ii = 0; ii < length; ii++)
{
chars[ii] = (char)(buffer.ReadByte() & unchecked((int)(0xff)));
}
return new string(chars, 0, length);
}
示例6: Read
public override string Read(IReadBuffer buffer, int length)
{
var chars = new char[length];
for (var ii = 0; ii < length; ii++)
{
chars[ii] = (char) ((buffer.ReadByte() & unchecked(0xff)) | ((buffer.ReadByte
() & unchecked(0xff)) << 8));
}
return new string(chars, 0, length);
}
示例7: QueryingReadContext
private QueryingReadContext(Transaction transaction, QCandidates candidates, int
handlerVersion, IReadBuffer buffer, int collectionID, IdObjectCollector collector
) : base(transaction, buffer)
{
_candidates = candidates;
_activationDepth = new LegacyActivationDepth(0);
_collectionID = collectionID;
_handlerVersion = handlerVersion;
_collector = collector;
}
示例8: ReadDimensions
private void ReadDimensions(ArrayInfo info, IReadBuffer buffer, int dimensionCount
)
{
var dim = new int[dimensionCount];
for (var i = 0; i < dim.Length; i++)
{
dim[i] = buffer.ReadInt();
}
((MultidimensionalArrayInfo) info).Dimensions(dim);
info.ElementCount(ElementCount(dim));
}
示例9: ReadLong
public static long ReadLong(IReadBuffer buffer)
{
long ret = 0;
if (Deploy.debug && Deploy.debugLong)
{
ret = long.Parse(new LatinStringIO().Read(buffer, Const4.LongBytes).Trim());
}
for (var i = 0; i < Const4.LongBytes; i++)
{
ret = (ret << 8) + (buffer.ReadByte() & unchecked(0xff));
}
return ret;
}
示例10: DoWithSlotIndirection
public virtual object DoWithSlotIndirection(IReadBuffer buffer, IClosure4 closure
)
{
int payLoadOffset = buffer.ReadInt();
buffer.ReadInt();
// length, not used
int savedOffset = buffer.Offset();
object res = null;
if (payLoadOffset != 0)
{
buffer.Seek(payLoadOffset);
res = closure.Run();
}
buffer.Seek(savedOffset);
return res;
}
示例11: _IClosure4_318
public _IClosure4_318(QCandidate _enclosing, ITypeHandler4 arrayElementHandler, IReadBuffer
buffer, QCandidates candidates)
{
this._enclosing = _enclosing;
this.arrayElementHandler = arrayElementHandler;
this.buffer = buffer;
this.candidates = candidates;
}
示例12: ReadArrayCandidates
private void ReadArrayCandidates(ITypeHandler4 typeHandler, IReadBuffer buffer, ITypeHandler4
arrayElementHandler, QCandidates candidates)
{
if (!Handlers4.IsCascading(arrayElementHandler))
{
return;
}
var slotFormat = SlotFormat.ForHandlerVersion(_handlerVersion);
slotFormat.DoWithSlotIndirection(buffer, typeHandler, new _IClosure4_318(this, arrayElementHandler
, buffer, candidates));
}
示例13: ReadEnd
public static void ReadEnd(IReadBuffer buffer)
{
if (Deploy.debug && Deploy.brackets)
{
if (buffer.ReadByte() != Const4.Yapend)
{
throw new Exception("Debug.readEnd() YAPEND expected");
}
}
}
示例14: _CollectIdContext_203
public _CollectIdContext_203(QueryingReadContext readContext, Transaction baseArg1
, IdObjectCollector baseArg2, ObjectHeader baseArg3, IReadBuffer baseArg4) : base
(baseArg1, baseArg2, baseArg3, baseArg4)
{
this.readContext = readContext;
}
示例15: ReadStringNoDebug
public static string ReadStringNoDebug(IContext context, IReadBuffer buffer)
{
return Intern(context, StringIo(context).ReadLengthAndString(buffer));
}