File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
core/src/test/scala/org/apache/spark/serializer Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -377,6 +377,20 @@ class KryoSerializerSuite extends SparkFunSuite with SharedSparkContext {
377377 Utils .deleteRecursively(dir)
378378 }
379379
380+ test(" KryoOutputObjectOutputBridge.writeObject and KryoInputObjectInputBridge.readObject" ) {
381+ val kryo = new KryoSerializer (conf).newKryo()
382+
383+ val bytesOutput = new ByteArrayOutputStream ()
384+ val objectOutput = new KryoOutputObjectOutputBridge (kryo, new KryoOutput (bytesOutput))
385+ objectOutput.writeObject(" test" )
386+ objectOutput.close()
387+
388+ val bytesInput = new ByteArrayInputStream (bytesOutput.toByteArray)
389+ val objectInput = new KryoInputObjectInputBridge (kryo, new KryoInput (bytesInput))
390+ assert(objectInput.readObject() === " test" )
391+ objectInput.close()
392+ }
393+
380394 test(" getAutoReset" ) {
381395 val ser = new KryoSerializer (new SparkConf ).newInstance().asInstanceOf [KryoSerializerInstance ]
382396 assert(ser.getAutoReset)
You can’t perform that action at this time.
0 commit comments