User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







java:io:printstream:write

This is an old revision of the document!


Table of Contents

write

Writes count or one byte to target stream/buffer.

write(int oneByte);
write(byte[] buffer, int offset, int length);

Language Example

      try {
 
        FileWriter stream = new FileWriter("output.txt"); // create file 
        BufferedWriter output = new BufferedWriter(stream);
 
        output.write("Hello Harddisk");             // Write to Stream
        output.close();                             //Close the output stream
       }
       catch (Exception e){
 
            System.err.println("Error: " + e.getMessage());
       }

output

  file content: Hello Harddisk
  
  or on console, e.g. on a Android System
  System.err Error: /output.txt (Read-only file system)
  
advertising
java/io/printstream/write.1353674823.txt · Last modified: 2013/09/09 09:07 (external edit)

Impressum Datenschutz

Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/9_2021 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/9_2021/misc_data.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/9_2021 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/9_2021/ip.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/9_2021 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/9_2021/pages.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/9_2021 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/9_2021/ua.ser failed
Creating directory /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/9_2021 failed
Writing /kunden/homepages/20/d423760527/htdocs/cpp/data/meta/quickstats/9_2021/page_users.ser failed