I'm am trying to send over socket a very big array - length about 1300000 .... and I use ObjectInputStream and ObjectOutputStream. The problem is when I read the input stream... I get this exception:
java.io.StreamCorruptedException: invalid type code: FF
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at objectThread.run(objectThread.java:27)
//ois is the ObjectInputStream
//o is an Object
while (ois != null && (o = ois.readObject()) != null) // here I got the exception
{
System.out.println("while entered...");
int[] r = (int[]) o;//get the array
}
Is the array to big? Or how can I send it over network in the most reliable way? Can somebody help please?