Java FileOutputStream sınıfı

Posted: September 19, 2014 in Java
Tags:

Verileri dosyaya yazmamızı sağlayan sınıftır. byte bazlı işlem yapar.

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

public class JavaApplication23 {

public static void main(String[] args) throws IOException {

File x =new File(“c:\\bayram\\hermes.txt”);

try
{
FileOutputStream y =new FileOutputStream(x);
String bilgi=”bayram”;
byte data [] =bilgi.getBytes();
y.write(data);
y.close();

}

catch(IOException a)
{
a.printStackTrace();
}

}

}

7

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s