private void CheckForPacketEnd(OscError error, int count) { if (Position + count > maxPosition) { throw new OscException(error, "Unexpected end of message"); } }
private string ReadStringInner(ref OscTypeTag typeTag, OscError error) { int stringStart = Position; bool failed = true; // scan forward and look for the end of the string while (Position < maxPosition) { if (buffer.Array[buffer.Offset + Position++] != 0) { continue; } failed = false; break; } if (failed) { throw new OscException(error, $@"Terminator could not be found while parsing argument '{typeTag.Index}'"); } string result = Encoding.UTF8.GetString(buffer.Array, buffer.Offset + stringStart, Position - stringStart - 1); // Advance pass the padding if (SkipPadding() == false) { throw new OscException(error, $"Unexpected end of message while parsing argument '{typeTag.Index}'"); } currentToken = typeTag.NextToken(); return(result); }
public OscException(OscError oscError, string message, Exception innerException) : base(message, innerException) { OscError = oscError; }
public OscException(OscError oscError, string message) : base(message) { OscError = oscError; }