/** * Writes the specified byte to this byte array output stream. * * @param b the byte to be written. */ public void write(int b) { ensureCapacity(1); _buffer[_count++] = (byte) b; }
public void writeByte(byte b) { ensureCapacity(1); _buffer[_count++] = b; }
/** * Writes <code>len</code> bytes from the specified byte array starting at offset * <code>off</code> to this byte array output stream. * * @param b the data. * @param off the start offset in the data. * @param len the number of bytes to write. */ public void write(byte b[], int off, int len) { if (len == 0) return; ensureCapacity(len); System.arraycopy(b, off, _buffer, _count, len); _count += len; }