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);
    } 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE