/* $Id: to.java,v 1.1 2002/07/17 16:38:46 comoc Exp $ */ /* * `gnu.iou' I/O buffers and utilities. * Copyright (C) 1998, 1999, 2000, 2001, 2002 John Pritchard. * * This program is free software; you can redistribute it or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA * 02111-1307 USA */ package gnu.iou.sh; import java.io.IOException; import java.io.OutputStream; /** * A stream for writing to a text component used by the shell's text * area. * * @see ShellTextArea * * @author John Pritchard (john@syntelos.org) */ public class to extends OutputStream { private final ShellTextArea ta; /** * A new stream * * @param ta User interface for writing to. */ public to( ShellTextArea ta){ super(); if ( null == ta) throw new IllegalArgumentException("Null `ta' text area argument to `to' constructor."); else this.ta = ta; } public void write(int b) throws IOException { this.ta._usr_write(b); } public void write(byte b[]) throws IOException { if ( null != b) this.ta._usr_write(b,0,b.length); } public void write(byte b[], int off, int len) throws IOException { this.ta._usr_write(b,off,len); } }