OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 67 | Rev 156 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 67 Rev 94
Line 13... Line 13...
13
 
13
 
14
 package org.openconcerto.utils;
14
 package org.openconcerto.utils;
15
 
15
 
16
import java.io.BufferedOutputStream;
16
import java.io.BufferedOutputStream;
17
import java.io.BufferedWriter;
17
import java.io.BufferedWriter;
-
 
18
import java.io.ByteArrayOutputStream;
18
import java.io.File;
19
import java.io.File;
19
import java.io.FileOutputStream;
20
import java.io.FileOutputStream;
20
import java.io.IOException;
21
import java.io.IOException;
21
import java.io.InputStream;
22
import java.io.InputStream;
22
import java.io.OutputStream;
23
import java.io.OutputStream;
Line 81... Line 82...
81
        } finally {
82
        } finally {
82
            ous.close();
83
            ous.close();
83
        }
84
        }
84
    }
85
    }
85
 
86
 
-
 
87
    /**
-
 
88
     * Read until the end of the stream is reached. NOTE : since this method didn't create the
-
 
89
     * stream, it doesn't close it.
-
 
90
     * 
-
 
91
     * @param ins the stream to read from.
-
 
92
     * @return the bytes.
-
 
93
     * @throws IOException if an error occurs.
-
 
94
     */
-
 
95
    public static byte[] read(final InputStream ins) throws IOException {
-
 
96
        final ByteArrayOutputStream out = new ByteArrayOutputStream(512);
-
 
97
        copy(ins, out);
-
 
98
        return out.toByteArray();
-
 
99
    }
-
 
100
 
86
    public static void writeln(final String s, final OutputStream out) throws IOException {
101
    public static void writeln(final String s, final OutputStream out) throws IOException {
87
        write(s + "\n", out);
102
        write(s + "\n", out);
88
    }
103
    }
89
 
104
 
90
    public static void write(final String s, final OutputStream out) throws IOException {
105
    public static void write(final String s, final OutputStream out) throws IOException {