Code example for ObjectOutput

Methods: flush, writeInt, writeObject

0
    public BitArray cloneArray() { 
	return(new BitArray(_intSize, _bits));
    } 
 
    public void writeExternal(ObjectOutput out) throws IOException {
	out.writeInt(_bitSize);
	out.writeInt(_mask);
	out.writeObject(_bits);
	out.flush();
    } 
 
    /** 
     * Read the whole tree from a file (serialized) 
     */ 
    public void readExternal(ObjectInput in)
	throws IOException, ClassNotFoundException { 
	_bitSize = in.readInt();
	_intSize = (_bitSize >>> 5) + 1;
	_mask    = in.readInt();
	_bits    = (int[])in.readObject();
    }