Code example for ObjectInputStream

Methods: closereadObject

0
            ByteArrayOutputStream buffer = new ByteArrayOutputStream(); 
            ObjectOutput out = new ObjectOutputStream(buffer); 
            out.writeObject(r1); 
            out.close(); 
 
            ObjectInput in = new ObjectInputStream( 
                    new ByteArrayInputStream(buffer.toByteArray())); 
            r2 = (AreaRenderer) in.readObject(); 
            in.close(); 
        } 
        catch (Exception e) { 
            e.printStackTrace(); 
        } 
        assertEquals(r1, r2); 
    } 
 
    /** 
     * A check for the datasetIndex and seriesIndex fields in the LegendItem 
     * returned by the getLegendItem() method. 
     */ 
Contextual code suggestions in your IDE  Get Codota for Java