using System;
using System.IO;

namespace bigloo
{
  public abstract class output_port: obj
  {
    public readonly byte[] name;

    protected output_port()
    {
      name= foreign.getbytes( "???" );
    }

    protected output_port( byte[]  name )
    {
      this.name= name;
    }

    public abstract Object close();

    public abstract Object flush();

    public Object bgl_output_port_seek( int  pos )
    {
      return bigloo.foreign.BFALSE;
    }

    public abstract void write( int  cn );

    public abstract void write( byte[]  s );

    public abstract void write( String  s );

    public override void write( output_port  p ) 
    {
      p.write( "#<output_port: " + foreign.newstring( name ) + ">" );
    }
  }
}
