Code example for ObjectOutputStream

Methods: writeBooleanwriteUTF

0
         * 
         * @param out 
         * @throws IOException 
         */ 
        private void writeObject(ObjectOutputStream out) throws IOException {
            if (diff == null) {
                out.writeBoolean(false);
            } else { 
                out.writeBoolean(false);
                out.writeUTF(diff);
            } 
        } 
 
        private void readObject(ObjectInputStream in) throws IOException,
                ClassNotFoundException { 
            boolean hasDiffString = in.readBoolean();
            if (hasDiffString) {
                diff = in.readUTF();
            } 
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE