Code example for DataOutput

Methods: writeDouble, writeUTF

0
        document = in.readUTF();
    } 
 
    @Override 
    public void write(DataOutput out) throws IOException {
        out.writeDouble(score);
        out.writeUTF(document);
    } 
 
    public String getDocument() {
        return document;
    } 
 
    public void setDocument(String document) {
        this.document = document;
    } 
 
    public double getScore() { 
        return score;
    }