本文整理汇总了C#中Apache.Qpid.Buffer.ByteBuffer.GetUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# ByteBuffer.GetUInt32方法的具体用法?C# ByteBuffer.GetUInt32怎么用?C# ByteBuffer.GetUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Apache.Qpid.Buffer.ByteBuffer
的用法示例。
在下文中一共展示了ByteBuffer.GetUInt32方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopulateMethodBodyFromBuffer
protected override void PopulateMethodBodyFromBuffer(ByteBuffer buffer)
{
Queue = EncodingUtils.ReadShortString(buffer);
MessageCount = buffer.GetUInt32();
ConsumerCount = buffer.GetUInt32();
}
示例2: PopulateMethodBodyFromBuffer
protected override void PopulateMethodBodyFromBuffer(ByteBuffer buffer)
{
PrefetchSize = buffer.GetUInt32();
PrefetchCount = buffer.GetUInt16();
ConsumeRate = buffer.GetUInt32();
bool[] bools = EncodingUtils.ReadBooleans(buffer);Global = bools[0];
}
示例3: PopulateMethodBodyFromBuffer
protected override void PopulateMethodBodyFromBuffer(ByteBuffer buffer)
{
ChannelMax = buffer.GetUInt16();
FrameMax = buffer.GetUInt32();
Heartbeat = buffer.GetUInt16();
}
示例4: Decodable
public MessageDecoderResult Decodable(ByteBuffer input)
{
if (_disabled)
{
return MessageDecoderResult.NOT_OK;
}
// final +1 represents the command end which we know we must require even
// if there is an empty body
if (input.Remaining < 1)
{
return MessageDecoderResult.NEED_DATA;
}
byte type = input.GetByte();
// we have to check this isn't a protocol initiation frame here - we can't tell later on and we end up
// waiting for more data. This could be improved if MINA supported some kind of state awareness when decoding
if ((char)type == 'A')
{
_logger.Error("Received what appears to be a protocol initiation frame");
return MessageDecoderResult.NOT_OK;
}
// zero, channel, body size and end byte
if (input.Remaining < (1 + 2 + 4 + 1))
{
return MessageDecoderResult.NEED_DATA;
}
int channel = input.GetUInt16();
long bodySize = input.GetUInt32();
// bodySize can be zero
if (type <= 0 || channel < 0 || bodySize < 0)
{
_logger.Error(String.Format("Error decoding frame: Type={0}, Channel={1}, BodySize={2}", type, channel, bodySize));
return MessageDecoderResult.NOT_OK;
}
if (input.Remaining < (bodySize + 1))
{
return MessageDecoderResult.NEED_DATA;
}
if (IsSupportedFrameType(type))
{
if (_logger.IsDebugEnabled)
{
// we have read 7 bytes so far, so output 7 + bodysize + 1 (for end byte) to get complete data block size
// this logging statement is useful when looking at exactly what size of data is coming in/out
// the broker
_logger.Debug("Able to decode data block of size " + (bodySize + 8));
}
return MessageDecoderResult.OK;
}
else
{
return MessageDecoderResult.NOT_OK;
}
}
示例5: PopulateMethodBodyFromBuffer
protected override void PopulateMethodBodyFromBuffer(ByteBuffer buffer)
{
Integer1 = buffer.GetByte();
Integer2 = buffer.GetUInt16();
Integer3 = buffer.GetUInt32();
Integer4 = buffer.GetUInt64();
Operation = buffer.GetByte();
}
示例6: PopulateMethodBodyFromBuffer
protected override void PopulateMethodBodyFromBuffer(ByteBuffer buffer)
{
DeliveryTag = buffer.GetUInt64();
bool[] bools = EncodingUtils.ReadBooleans(buffer);Redelivered = bools[0];
Exchange = EncodingUtils.ReadShortString(buffer);
RoutingKey = EncodingUtils.ReadShortString(buffer);
MessageCount = buffer.GetUInt32();
}
示例7: ReadUnsignedInteger
public static uint ReadUnsignedInteger(ByteBuffer buffer)
{
return buffer.GetUInt32();
}
示例8: ReadFieldTable
/// <summary>
/// Reads the field table using the data in the specified buffer
/// </summary>
/// <param name="buffer">The buffer to read from.</param>
/// <returns>a populated field table</returns>
/// <exception cref="AMQFrameDecodingException">if the buffer does not contain a decodable field table</exception>
public static FieldTable ReadFieldTable(ByteBuffer buffer)
{
uint length = buffer.GetUInt32();
if ( length == 0 )
{
return null;
} else
{
return new FieldTable(buffer, length);
}
}
示例9: ReadLongstr
public static byte[] ReadLongstr(ByteBuffer buffer)
{
uint length = buffer.GetUInt32();
if ( length == 0 )
{
return null;
} else
{
byte[] result = new byte[length];
buffer.GetBytes(result);
return result;
}
}
示例10: ReadLongString
public static string ReadLongString(ByteBuffer buffer, Encoding encoding)
{
uint length = buffer.GetUInt32();
if ( length == 0 )
{
return null;
} else
{
byte[] data = new byte[length];
buffer.GetBytes(data);
lock ( encoding )
{
return encoding.GetString(data);
}
}
}
示例11: PopulateMethodBodyFromBuffer
protected override void PopulateMethodBodyFromBuffer(ByteBuffer buffer)
{
ContentChecksum = buffer.GetUInt32();
}
示例12: PopulateMethodBodyFromBuffer
protected override void PopulateMethodBodyFromBuffer(ByteBuffer buffer)
{
MessageCount = buffer.GetUInt32();
}
示例13: CreateAndPopulateFrame
protected Object CreateAndPopulateFrame(ByteBuffer input)
{
byte type = input.GetByte();
ushort channel = input.GetUInt16();
uint bodySize = input.GetUInt32();
IBodyFactory bodyFactory = (IBodyFactory)_supportedBodies[type];
if (bodyFactory == null)
{
throw new AMQFrameDecodingException("Unsupported body type: " + type);
}
AMQFrame frame = new AMQFrame();
frame.PopulateFromBuffer(input, channel, bodySize, bodyFactory);
byte marker = input.GetByte();
if (marker != 0xCE) {
throw new FormatException("marker is not 0xCE");
}
return frame;
}