public static Object output_obj( binary_port p, Object obj ) { return p.output_obj( obj ); }
public static Object close_binary_port( binary_port p ) { return p.close(); }
public static Object input_obj( binary_port p ) { return p.input_obj(); }
public static bool BINARY_PORT_OUTP( binary_port p ) { return p.stream.CanWrite; }
public static Object BINARY_PORT_TO_FILE( binary_port p ) { return p.stream; }
public static int bgl_output_string( binary_port p, byte[] buf ) { p.stream.Write( buf, 0, buf.Length ); return buf.Length; }
public static bool BINARY_PORT_INP( binary_port p ) { return p.stream.CanRead; }
public static Object BGL_OUTPUT_CHAR( binary_port p, byte c) { p.stream.WriteByte( c ); return p; }
public static byte[] bgl_input_string( binary_port p, int len ) { byte[] buf = new byte[ len ]; int l = p.stream.Read( buf, 0, buf.Length ); if( l < len ) return bgl_string_shrink( buf, l ); else return buf; }
public static int bgl_input_fill_string( binary_port p, byte[] buf ) { return p.stream.Read( buf, 0, buf.Length ); }
public static int BGL_INPUT_CHAR( binary_port p ) { return p.stream.ReadByte(); }
public static Object bgl_flush_binary_port( binary_port p ) { return p.flush(); }