summaryrefslogtreecommitdiff
path: root/javalib/src/main/scala/java/io/FilterOutputStream.scala
blob: 299b7b6353be7daeecc00bce59fc7c8913693420 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package java.io

class FilterOutputStream(protected val out: OutputStream) extends OutputStream {
  def write(b: Int): Unit =
    out.write(b)

  override def write(b: Array[Byte]): Unit =
    write(b, 0, b.length) // this is spec! it must not call out.write(b)

  override def write(b: Array[Byte], off: Int, len: Int): Unit =
    super.write(b, off, len) // calls this.write(Int) repeatedly

  override def flush(): Unit = out.flush()

  override def close(): Unit = out.close()
}