/// <summary> /// Provides access to the underlying buffer for the given <see cref="JobPointer"/>. /// </summary> /// <param name="context"></param> /// <param name="job"></param> /// <param name="io_id"></param> /// <param name="resultBuffer"></param> /// <returns></returns> /// <exception cref="BufferOverflowException"></exception> public static bool imageflow_job_get_output_buffer_by_id(ContextPointer context, JobPointer job, int io_id, out JsonReader resultBuffer) { IntPtr resultBufferPointer; long bufferSize; bool @return = imageflow_job_get_output_buffer_by_id(context, job, io_id, out resultBufferPointer, out bufferSize); if (!@return) { resultBuffer = null; return(false); } #pragma warning disable HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation resultBuffer = new UnmanagedJsonReader(resultBufferPointer, bufferSize); #pragma warning restore HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation return(true); }
/// <summary> /// Writes fields from the given imageflow_json_response to the locations referenced. /// </summary> /// <param name="context"></param> /// <param name="response_in"></param> /// <param name="status_code_out"></param> /// <param name="buffer"></param> /// <returns></returns> /// <exception cref="BufferOverflowException"></exception> public static bool imageflow_json_response_read(ContextPointer context, JsonResponsePointer response_in, out long status_code_out, out JsonReader buffer) { IntPtr bufferPointer; IntPtr bufferSize; bool result = imageflow_json_response_read(context, response_in, out status_code_out, out bufferPointer, out bufferSize); if (!result) { buffer = null; return(false); } #pragma warning disable HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation buffer = new UnmanagedJsonReader(bufferPointer, bufferSize.ToInt64()); #pragma warning restore HeapAnalyzerExplicitNewObjectRule // Explicit new reference type allocation return(true); }