/** * Writes the specified byte to this buffered output stream. * * @param b the byte to be written * @throws IOException if an I/O error occurs */ @Override public synchronized void write(int b) throws IOException { if (count >= buffer.length) flushBuffer(); buffer[count++] = (byte)b; }
/** * Flushes this buffered output stream. This forces any buffered * output bytes to be written out to the underlying output stream. * * @throws IOException if an I/O error occurs. */ @Override public synchronized void flush() throws IOException { flushBuffer(); raos.flush(); }
flushBuffer(); raos.write(b, off, len); return; flushBuffer();