Stream of consciousness is a radical style perfected by modernist writers like James Joyce and Virginia Woolf. In general, stream of consciousness is a style of writing that mimics the way real people think. For the most part, people don't think in tidy, grammatically correct sentences and paragraphs; instead, our thoughts flow together in run-on sentences and fragments, tumbling all over the place like a "stream" of our own "consciousness." Writers have approached the representation of this fact in many different ways. Joyce, for instance, painstakingly wrote, edited, and rewrote his prose so that it had the appearance of free-flowing thought. Jack Kerouac, however, simply wrote down the first things that came into his brain, thus taking the idea of stream of consciousness to a literal degree.
Joyce's Portrait is an interesting example of stream of consciousness. The novel's prose mimics the consciousness of its protagonist, Stephen Dedalus, as he grows up in Dublin. The writing style starts out as babbling and incoherent baby-talk, and gradually matures into the complex and intricate musings of an erudite young scholar. In this way, the prose is stream of consciousness. That said, Portrait itself represents an intriguing adolescent phase of Joyce's writing. While there are certainly radical elements in Portrait, Joyce maintains some conventions of traditional narrative (Joyce will, for instance, permit himself to describe how characters look when they talk), and so the novel's style is not as radically stream of consciousness as Ulysses. In this later novel, whole chapters take place within the minds of characters without any (or at least very little) interruption from a conventional narrator. Thus, while Joyce certainly dabbles in stream of consciousness in Portrait, it is an incomplete form of the style, and he has yet to reach the perfection that he achieves in Ulysses.