internal uint PopWiredUInt() { //int i = PopWiredInt32(); //try //{ // return (uint)i; //} //catch (Exception e) //{ // Logging.LogException("OVerflow: I: " + i); // thRow e; //} if (RemainingLength < 1) { return(0); } byte[] Data = PlainReadBytes(WireEncoding.MAX_INTEGER_BYTE_AMOUNT); Int32 TotalBytes = 0; uint i = WireEncoding.DecodeUInt32(Data, out TotalBytes); Pointer += TotalBytes; return(i); }
public int ReadVL64() { int value = WireEncoding.DecodeInt32(GetBytes(buffer.ReadableBytes), out int totalBytes); ReadBytes(totalBytes); return(value); }
public int PopWiredInt32() { if (this.RemainingLength < 1) { return(0); } byte[] bzData = this.PlainReadBytes(6); int totalBytes = 0; int num2 = WireEncoding.DecodeInt32(bzData, out totalBytes); this.Pointer += totalBytes; return(num2); }
/// <summary> /// Reads the next wire encoded 32 bit integer from the message content and advances the reader cursor. /// </summary> /// <returns>Int32</returns> public Int32 PopWiredInt32() { if (GetRemainingContent() == 0) { return(0); } byte[] bzData = ReadBytesFreezeCursor(WireEncoding.MaxIntegerByteAmount); int totalBytes; int i = WireEncoding.DecodeInt32(bzData, out totalBytes); _contentCursor += totalBytes; return(i); }
public int GetInt32() { try { var Bytes = GetBytes(WireEncoding.MAX_INTEGER_BYTE_AMOUNT); var Length = new int(); var Result = WireEncoding.DecodeInt32(Bytes, out Length); PointerLength += Length; return(Result); } catch { return(0); } }
/// <summary> /// Reads the next wire encoded 32 bit integer from the message content and advances the reader cursor. /// </summary> /// <returns>Int32</returns> internal Int32 PopWiredInt32() { if (this.remainingContent == 0) { return(0); } byte[] bzData = this.ReadBytesFreezeCursor(WireEncoding.MAX_INTEGER_BYTE_AMOUNT); Int32 totalBytes = 0; Int32 i = WireEncoding.DecodeInt32(bzData, out totalBytes); fContentCursor += totalBytes; return(i); }
internal Int32 PopWiredInt32() { if (RemainingLength < 1) { return(0); } byte[] Data = PlainReadBytes(WireEncoding.MAX_INTEGER_BYTE_AMOUNT); Int32 TotalBytes = 0; Int32 i = WireEncoding.DecodeInt32(Data, out TotalBytes); Pointer += TotalBytes; return(i); }
public void Append(object Item) { var Type = Item.GetType(); if (Type == typeof(int)) { this.Content.AddRange(WireEncoding.EncodeInt32((int)Item)); } else if (Type == typeof(string)) { this.Content.AddRange(Encoding.ASCII.GetBytes(Item as string)); this.Content.Add(STRING_CHARACTER); } else if (Type == typeof(bool)) { this.Content.AddRange(WireEncoding.EncodeInt32((bool)Item ? 1 : 0)); } }
public int PopWiredInt32() { int i; if (this.RemainingLength < 1) { i = 0; } else { byte[] Data = this.PlainReadBytes(6); int TotalBytes = 0; int num2 = WireEncoding.DecodeInt32(Data, out TotalBytes); this.Pointer += TotalBytes; i = num2; } return(i); }
internal void AppendInt32(Int32 i) { AppendBytes(WireEncoding.EncodeInt32(i)); }
public void AppendInt32(int i) { this.AppendBytes(WireEncoding.EncodeInt32(i)); }
public void AppendInt32(Int32 i) { AppendBytes(WireEncoding.EncodeInt32(i)); }
public void AppendInt32WithBreak(int i, byte BreakChar) { this.AppendBytes(WireEncoding.EncodeInt32(i)); this.AppendByte(BreakChar); }
public void AppendInt32WithBreak(int i) { this.AppendBytes(WireEncoding.EncodeInt32(i)); this.AppendByte(2); }
/// <summary> /// Appends a wire encoded 32 bit integer to the message content. /// </summary> /// <param name = "i">The 32 bit integer to encode and append.</param> public IInternalOutgoingMessage AppendInt32(Int32 i) { Append(WireEncoding.EncodeInt32(i)); return(this); }
public void AppendVL64(int value) { buffer.AddRange(WireEncoding.EncodeInt32(value)); }