package org.ligi.axt.helpers;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;

public class InputStreamAXT {

    private final InputStream inputStream;

    public InputStreamAXT(InputStream inputStream) {
        this.inputStream = inputStream;
    }

    public void toFile(File f) throws IOException {
        FileOutputStream fos = new FileOutputStream(f);

        byte[] buffer = new byte[1024];
        int len;

        while ((len = inputStream.read(buffer)) > 0) {
            fos.write(buffer, 0, len);
        }

    }
}

@@ -24,16 +24,47 @@
 lpers;%0A%0A
+import java.io.BufferedReader;%0A
 import j
@@ -76,16 +76,16 @@
 o.File;%0A
-
 import j
@@ -164,16 +164,50 @@
 tStream;
+%0Aimport java.io.InputStreamReader;
 %0A%0Apublic
@@ -652,11 +652,412 @@
 %7D%0A%0A    %7D
+%0A%0A    public String readToString() throws IOException %7B%0A        InputStreamReader is = new InputStreamReader(inputStream);%0A        StringBuilder sb = new StringBuilder();%0A        BufferedReader br = new BufferedReader(is);%0A        String read = br.readLine();%0A%0A        while (read != null) %7B%0A            sb.append(read);%0A            read = br.readLine();%0A        %7D%0A%0A        return sb.toString();%0A    %7D
 %0A%7D%0A

add function to read ins to string