How to write and read the byte array to DataInput and DataOutput Stream How to write and read the byte array to DataInput and DataOutput Stream hadoop hadoop

How to write and read the byte array to DataInput and DataOutput Stream


You didn't initialize your byte array:

byte [] test = null;

Should be:

byte [] test = new byte[length];