public static SimpleBuffer readFromFile(string path) { byte[] arr = File.ReadAllBytes(path); SimpleBuffer buf = new SimpleBuffer(); buf.setInternalBuffer(arr, arr.Length); return(buf); }
public virtual void postMessage(globalmq.marshalling.BufferT buff) { int sz = buff.size(); byte[] arr; globalmq.marshalling.SimpleBuffer sb = buff as globalmq.marshalling.SimpleBuffer; if (sb == null) { throw new Exception(String.Format("Unsupported buffer type '{0}'", buff.GetType())); } arr = sb.getInternalBuffer(); ErrorCodeT retCode = postMessage(handle, arr, sz); checkError(retCode); // throws in case of retCode != 0 }