“BufferedInputStream” Code-Antworten

Java erstellt einen BufferedInputStream

// Creates a FileInputStream
FileInputStream file = new FileInputStream(String path);

// Creates a BufferedInputStream
BufferedInputStream buffer = new BufferInputStream(file);
SAMER SAEID

BufferedInputStream

try {
    // create a reader
    FileInputStream fis = new FileInputStream(new File("input.dat"));
    BufferedInputStream reader = new BufferedInputStream(fis);

    // read one byte at a time
    int ch;
    while ((ch = reader.read()) != -1) {
        System.out.print((char) ch);
    }

    // close the reader
    reader.close();

} catch (IOException ex) {
    ex.printStackTrace();
}
Wild Wolverine

Java erzeugt einen buffertenOutputstream

// Creates a FileOutputStream
FileOutputStream file = new FileOutputStream(String path);

// Creates a BufferedOutputStream
BufferedOutputStream buffer = new BufferOutputStream(file);
SAMER SAEID

Ähnliche Antworten wie “BufferedInputStream”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen