Java IO ile ilgili bişeyler

kodda OutputStreamWriter hakkında iki örnek var:

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

  ByteArrayOutputStream out = new ByteArrayOutputStream();
  OutputStreamWriter ow = new OutputStreamWriter(out);

  ow.write("Constructor argument is ByteArrayOutStream object");
  ow.flush();
  System.out.println(out.toString());

  FileOutputStream flt = new FileOutputStream(new File("D:/madvens.txt"));
  ow = new OutputStreamWriter(flt);
  ow.append("welcome to https://madvens.wordpress.com");

  System.out.println("\nAppended sequence of characters will generate in a file madvens.txt");
  ow.flush();
}

Java IO Class Overview Table

Byte Based Character Based
Input Output Input Output
Basic InputStream OutputStream Reader
InputStreamReader
Writer
OutputStreamWriter
Arrays ByteArrayInputStream ByteArrayOutputStream CharArrayReader CharArrayWriter
Files FileInputStream
RandomAccessFile
FileOutputStream
RandomAccessFile
FileReader FileWriter
Pipes PipedInputStream PipedOutputStream PipedReader PipedWriter
Buffering BufferedInputStream BufferedOutputStream BufferedReader BufferedWriter
Filtering FilterInputStream FilterOutputStream FilterReader FilterWriter
Parsing PushbackInputStream
StreamTokenizer
PushbackReader
LineNumberReader
Strings StringReader StringWriter
Data DataInputStream DataOutputStream
Data – Formatted PrintStream PrintWriter
Objects ObjectInputStream ObjectOutputStream
Utilities SequenceInputStream
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