Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private object ReadByTypeCode(typeCode TypeCode, byte[] bufferData, ref ushort offset, ushort length)
- {
- object result = null;
- switch (typeCode)
- {
- case TypeCode.Int32:
- {
- result = BitConverter.ToInt32(bufferData, offset);
- offset += length;
- break;
- }
- case TypeCode.Double:
- {
- result = BitConverter.ToDouble(bufferData, offset);
- offset += length;
- break;
- }
- case TypeCode.String:
- {
- result = Encoding.ASCII.GetString(bufferData, offset, length);
- offset += length;
- break;
- }
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement