title: error writing PubSub stream to Cloud Storage using Dataflow
body: <p>Using  <a href="https://github.com/spotify/scio" rel="nofollow">SCIO</a> from <code>spotify</code> to write a job for <code>Dataflow</code> , following 2 examples <a href="https://github.com/spotify/scio/blob/master/scio-examples/src/main/scala/com/spotify/scio/examples/complete/StreamingWordExtract.scala" rel="nofollow">e.g1</a> and <a href="https://github.com/spotify/scio/blob/master/scio-examples/src/main/scala/com/spotify/scio/examples/WindowedWordCount.scala" rel="nofollow">e.g2</a> to write a <code>PubSub</code> stream to <code>GCS</code>,  but get the following error for the below code</p>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: Write can only be applied to a Bounded PCollection 
  </code></pre>
  
  <p><strong>Code</strong></p>
  
  <pre><code>object StreamingPubSub {
    def main(cmdlineArgs: Array[String]): Unit = {
  // set up example wiring
  val (opts, args) = ScioContext.parseArguments[ExampleOptions](cmdlineArgs)
  val dataflowUtils = new DataflowExampleUtils(opts)
  dataflowUtils.setup()
  
  val sc = ScioContext(opts)
  
  
  sc.pubsubTopic(opts.getPubsubTopic)
  .timestampBy {
      _ =&gt; new Instant(System.currentTimeMillis() - (scala.math.random * RAND_RANGE).toLong)
    }
  .withFixedWindows((Duration.standardHours(1)))
  .groupBy(_ =&gt; Unit)
  .toWindowed
  .toSCollection
  .saveAsTextFile(args("output"))
  
  
  val result = sc.close()
  
  // CTRL-C to cancel the streaming pipeline
      dataflowUtils.waitToFinish(result.internal)
    }
  }
  </code></pre>
  
  <p>I maybe mixing up the window concept with Bounded PCollection, is there a way to achieve this or do I need to apply some transform to make this happen, anyone can be of assistance on this</p>