Neeraj K

Neeraj K

  • NA
  • 57
  • 7.1k

Getting error while de-serializing cassandra column with custom type

Feb 16 2021 5:52 PM

Getting error while de-serializing cassandra column with custom type using c# code

Cassandra sink connector (by lenses.io) is inserting data to one of the cassandra column of custom type - list<frozen<customType>>

Now when i am trying to read this column data it returns byte[] and when I am de-serializing same using Dot Net code then getting below error -

"The input stream is not a valid binary format. The starting contents (in bytes) are: 43-53-52-30-30-30-30-30-30-30-32-31-00-00-00-0F-46 ..."


MemoryStream memStream = new MemoryStream();

BinaryFormatter binForm = new BinaryFormatter()

memStream.Write(arrBytes, 0, arrBytes.Length);

memStream.Seek(0, SeekOrigin.Begin);

object obj = (object)binForm.Deserialize(memStream); ----> This line is throwing error

"The input stream is not a valid binary format. The starting contents (in bytes) are: 43-53-52-30-30-30-30-30-30-30-32-31-00-00-00-0F-46 ..."