Storing the byte[] instead ByteBuffer as ByteBuffer was giving Serialization issues in Spark