ByteArrayOutputStream


ByteArrayOutputStream java.io

Java 1.0 closeable flushable

This class is a subclass of OutputStream in which output data is stored in an internal byte array. The internal array grows as necessary and can be retrieved with toByteArray( ) or toString( ) . The reset( ) method discards any data currently stored in the internal array and stores data from the beginning again. See also CharArrayWriter .

Figure 9-6. java.io.ByteArrayOutputStream

 public class  ByteArrayOutputStream  extends OutputStream {  // Public Constructors  public  ByteArrayOutputStream  ( );        public  ByteArrayOutputStream  (int  size  );  // Public Instance Methods  public void  reset  ( );  synchronized  public int  size  ( );        public byte[ ]  toByteArray  ( );  synchronized   1.1  public String  toString  (String  enc  ) throws UnsupportedEncodingException;        public void  writeTo  (OutputStream  out  ) throws IOException;  synchronized   // Public Methods Overriding OutputStream   1.2  public void  close  ( ) throws IOException;  empty  public void  write  (int  b  );  synchronized  public void  write  (byte[ ]  b  , int  off  , int  len  );  synchronized   // Public Methods Overriding Object  public String  toString  ( );  // Protected Instance Fields  protected byte[ ]  buf  ;        protected int  count  ;  // Deprecated Public Methods   #  public String  toString  (int  hibyte  );   } 



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net