Skip to content

Commit

Permalink
Revert "[SPARK-12060][CORE] Avoid memory copy in JavaSerializerInstan…
Browse files Browse the repository at this point in the history
…ce.serialize"

This reverts commit 1401166.
  • Loading branch information
zsxwing committed Dec 1, 2015
1 parent 60b541e commit 328b757
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import scala.reflect.ClassTag

import org.apache.spark.SparkConf
import org.apache.spark.annotation.DeveloperApi
import org.apache.spark.util.{ByteBufferInputStream, ByteBufferOutputStream, Utils}
import org.apache.spark.util.ByteBufferInputStream
import org.apache.spark.util.Utils

private[spark] class JavaSerializationStream(
out: OutputStream, counterReset: Int, extraDebugInfo: Boolean)
Expand Down Expand Up @@ -95,11 +96,11 @@ private[spark] class JavaSerializerInstance(
extends SerializerInstance {

override def serialize[T: ClassTag](t: T): ByteBuffer = {
val bos = new ByteBufferOutputStream()
val bos = new ByteArrayOutputStream()
val out = serializeStream(bos)
out.writeObject(t)
out.close()
bos.toByteBuffer
ByteBuffer.wrap(bos.toByteArray)
}

override def deserialize[T: ClassTag](bytes: ByteBuffer): T = {
Expand Down

This file was deleted.

0 comments on commit 328b757

Please sign in to comment.