Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/266#discussion_r11320767
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/util/RawTextSender.scala ---
    @@ -45,16 +43,15 @@ object RawTextSender extends Logging {
     
         // Repeat the input data multiple times to fill in a buffer
         val lines = Source.fromFile(file).getLines().toArray
    -    val bufferStream = new FastByteArrayOutputStream(blockSize + 1000)
    +    val bufferStream = new ByteArrayOutputStream(blockSize + 1000)
         val ser = new KryoSerializer(new SparkConf()).newInstance()
         val serStream = ser.serializeStream(bufferStream)
         var i = 0
    -    while (bufferStream.position < blockSize) {
    +    while (bufferStream.size < blockSize) {
    --- End diff --
    
    Yes it's the the count of bytes written:
    ```
    val stream = new java.io.ByteArrayOutputStream(1000)
    stream.write(-1)
    stream.size
    res1: Int = 1
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to