Name

java.io.ByteArrayOutputStream

Synopsis

This class is a slightly smaller version of its J2SE counterpart. It is a subclass of java.io.OutputStream, which writes data out as a series of bytes.

public classByteArrayOutputStream extends java.io.OutputStream {
   // protected fields
   protected byte[] buf;
   protected int count;

   // constructors
   public ByteArrayOutputStream();
   public ByteArrayOutputStream(int size);

   // public instance methods
   public synchronized void close() throws java.io.IOException;
   public synchronized void reset();
   public int size();
   public synchronized byte[] toByteArray();
   public String toString();
   public synchronized void write(int b);
   public synchronized void write(byte[] b, int off, int len);
   }

Get Wireless Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.