Code example for DataInput

Methods: readFullyreadInt

0
        return r;
    } 
 
    @Override 
    void read(final DataInput in) throws IOException {
        final int s = in.readInt();
        final byte[] p = new byte[s];
        in.readFully(p);
        payload = p;
    } 
 
    @Override 
    void write(final DataOutput out) throws IOException {
        out.writeInt(payload.length);
        out.write(payload);
    } 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java