package rb;

import java.io.ByteArrayInputStream;
import java.io.InputStream;

/**
 * Created by IntelliJ IDEA.
 * User: Gong Zeng
 * Date: 5/16/11
 * Time: 12:12 PM
 */
public class MemoryFile {
    String name;
    String content;

    public MemoryFile(String name, String diff) {
        this.name = name;
        this.content = diff;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public InputStream getInputStream() {
        return new ByteArrayInputStream(content.getBytes());
    }
}

@@ -74,16 +74,62 @@
 Stream;%0D
+%0Aimport java.io.UnsupportedEncodingException;%0D
 %0A%0D%0A/**%0D%0A
@@ -738,16 +738,52 @@
 Stream()
+ throws UnsupportedEncodingException
  %7B%0D%0A    
@@ -835,16 +835,23 @@
 etBytes(
+%22utf-8%22
 ));%0D%0A   

Set default encoding of diff file to utf-8 according of issue reported by @yqt: diff file gets wrong encoding