public static void bgl_input_port_buffer_set(input_port o, byte[] b) { o.bufsiz = b.Length; o.buffer = b; if( !(o is input_string_port) ) { b[ 0 ] = 0; } }