Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/linpoch/kde/dcop/FileContentAnswer.java


1   package org.linpoch.kde.dcop;
2   
3   import java.io.DataOutputStream;
4   import java.io.IOException;
5   
6   import org.kde.dcop.Marchaller;
7   
8   /**
9    *
10   * @author Gert-Jan van der Heiden
11   */
12  public class FileContentAnswer {
13    byte[] content;
14    String errorMessage;
15    public FileContentAnswer(String errorMessage){
16      this.setErrorMessage(errorMessage);
17    }
18    public FileContentAnswer(byte[] content){
19      this.setContent(content);
20    }
21    public void setContent(byte[] content){
22      this.content = content;
23    }
24    public byte[] getContent(){
25      if(this.content==null)
26        this.setContent(new byte[0]);
27      return this.content;
28    }
29    public void setErrorMessage(String message){
30      this.errorMessage = message;
31    }
32    public String getErrorMessage(){
33      if(this.errorMessage == null)
34        this.errorMessage = "";
35      return this.errorMessage;
36    }
37    public void write(DataOutputStream stream) throws IOException{
38      Marchaller.write_QByteArray(stream,this.getContent());
39      Marchaller.write_QString(stream,this.getErrorMessage());
40    }
41  }