# TIP: Streams are Observable in Codename One

DevFeed: [TIP: Streams are Observable in Codename One](<https://devfeed.tech/articles/tip-streams-are-observable-in-codename-one-19599.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/tip-streams-observable/>)

Author: Shai Almog

Published: 2018-02-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [Streams](<https://devfeed.tech/topics/streams.md>), [IO](<https://devfeed.tech/topics/io.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [developers](<https://devfeed.tech/tags/developers.md>), [io](<https://devfeed.tech/tags/io.md>), [java](<https://devfeed.tech/tags/java.md>), [streams](<https://devfeed.tech/tags/streams.md>)

## AI overview

This Codename One tip explains that its internal APIs return customized BufferedInputStream and BufferedOutputStream instances from the com.codename1.io package. These observable streams support adding functionality while preserving Java compatibility, including progress tracking through setProgressListener(IOProgressListener).

## Source excerpt

We got a pull request the other day that reminded me of some hidden functionality in Codename One that most developers aren't aware of: observable input streams. By default Codename One API's try to return BufferedInputStream and BufferedOutputStream instances from our internal API's. Those classes aren't the typical java.io versions but rather ones from the com.codename1.io package. That API allows us to add functionality into the streams without breaking the Java compatibility or specs. One such feature is setProgressListener(IOProgressListener). This is probably better explained with a simple sample: