Skip to content

Commit

Permalink
revert the write
Browse files Browse the repository at this point in the history
  • Loading branch information
chenghao-intel committed Jun 29, 2015
1 parent 76ff46b commit bfedd77
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2341,22 +2341,10 @@ private[spark] class RedirectThread(
*/
private[spark] class CircularBuffer(sizeInBytes: Int = 10240) extends java.io.OutputStream {
var pos: Int = 0
var buffer = new Array[Byte](sizeInBytes)
var buffer = new Array[Int](sizeInBytes)

/**
* Writes the specified byte to this output stream. The general
* contract for [[write]] is that one byte is written
* to the output stream. The byte to be written is the eight
* low-order bits of the argument `i`. The 24
* high-order bits of `i` are ignored.
*
* Subclasses of [[OutputStream]] must provide an
* implementation for this method.
*
* @param i the byte to be written.
*/
override def write(i: Int): Unit = {
buffer(pos) = i.asInstanceOf[Byte]
def write(i: Int): Unit = {
buffer(pos) = i
pos = (pos + 1) % buffer.length
}

Expand Down

0 comments on commit bfedd77

Please sign in to comment.