SlideShare a Scribd company logo
import java.io.*;
class BufferTest {
public static void main(String args[]){
//creat stream
FileReader fileReader = null;
BufferedReader bufferedReader = null;
FileWriter fileWriter = null;
BufferedWriter bufferedWriter = null;
String line = null;
try{
//acquire origin file address
fileReader = new FileReader("f:/excise/Stream/zzz.txt");
//output path of generated file
fileWriter = new FileWriter("f:/excise/Stream/aaa.txt");
//write buffer stream
bufferedReader = new BufferedReader(fileReader);
//write buffer stream
bufferedWriter = new BufferedWriter(fileWriter);
//read data iteratively
while(true){
//read one line data
line = bufferedReader.readLine();
if(line == null){
break;
}
String str = line.toUpperCase();//to uppercase
//String str = line.toLowerCase(); to lowercase
//output buffer stream
bufferedWriter.write(str);
//change line
bufferedWriter.newLine();
}
}
catch(Exception e){
System.out.println(e);
}finally{
try{
//close stream
fileReader.close();
bufferedReader.close();
bufferedWriter.close();
fileWriter.close();
}
catch(Exception e){
System.out.println(e);
}
}
}
}

More Related Content

PPTX
MongoDB
PPTX
Exported resources design patterns
PDF
Cpp lab 13_pres
DOCX
Exmaples of file handling
PDF
Gsummit apis-2012
PPTX
Tutorial on Node File System
PDF
From Overnight to Always On @ Jfokus 2019
PPT
eZ Publish cluster unleashed revisited
MongoDB
Exported resources design patterns
Cpp lab 13_pres
Exmaples of file handling
Gsummit apis-2012
Tutorial on Node File System
From Overnight to Always On @ Jfokus 2019
eZ Publish cluster unleashed revisited

What's hot (20)

TXT
Read exceldemo
PDF
Building a userspace filesystem in node.js
PDF
Lucene InputFormat (lightning talk) - TriHUG December 10, 2013
PDF
Mongo db basics
PPT
PHP file
PPTX
Building .NET Apps using Couchbase Lite
PDF
Linker Wisdom
PDF
MongoDB Quick Reference Card
PDF
Object Storage with Gluster
DOCX
Import java
PDF
Need It Robust? Make It Fragile!
PDF
Hypertable Nosql
RTF
SPHE-00727_description
ODP
Introduction to MongoDB with PHP
PPTX
Chapter iii(working with data)
TXT
File handling complete programs in c++
PDF
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
PPTX
07 darwino rest services
PDF
MongoDB Munich 2012: MongoDB for official documents in Bavaria
PPTX
File upload php
Read exceldemo
Building a userspace filesystem in node.js
Lucene InputFormat (lightning talk) - TriHUG December 10, 2013
Mongo db basics
PHP file
Building .NET Apps using Couchbase Lite
Linker Wisdom
MongoDB Quick Reference Card
Object Storage with Gluster
Import java
Need It Robust? Make It Fragile!
Hypertable Nosql
SPHE-00727_description
Introduction to MongoDB with PHP
Chapter iii(working with data)
File handling complete programs in c++
Replacing Oracle with MongoDB for a templating application at the Bavarian go...
07 darwino rest services
MongoDB Munich 2012: MongoDB for official documents in Bavaria
File upload php
Ad

Similar to Android APP-toggle case (20)

PDF
Java I/o streams
PDF
5. Ввод-вывод, доступ к файловой системе
PPTX
Java file
PDF
Create a text file named lnfo.txt. Enter the following informatio.pdf
PDF
Input File dalam C++
PPTX
Java - Processing input and output
PDF
11_Str11_Streams.11_Streams.11_Streams.11_Streams.11_Streams.11_Streams.eams.pdf
PPT
Java căn bản - Chapter12
PPT
Chapter 12 - File Input and Output
PDF
In Java Write a program that reads a file that contains only on.pdf
PPT
File Input & Output
PPTX
working with files
PPT
data file handling
PPTX
6. chapter v
PDF
Filesinc 130512002619-phpapp01
PPSX
Files in c++
PDF
Chapter28 data-file-handling
PPTX
PPS PPT 2.pptx
PDF
Advance C Programming UNIT 4-FILE HANDLING IN C.pdf
PPTX
File Organization
Java I/o streams
5. Ввод-вывод, доступ к файловой системе
Java file
Create a text file named lnfo.txt. Enter the following informatio.pdf
Input File dalam C++
Java - Processing input and output
11_Str11_Streams.11_Streams.11_Streams.11_Streams.11_Streams.11_Streams.eams.pdf
Java căn bản - Chapter12
Chapter 12 - File Input and Output
In Java Write a program that reads a file that contains only on.pdf
File Input & Output
working with files
data file handling
6. chapter v
Filesinc 130512002619-phpapp01
Files in c++
Chapter28 data-file-handling
PPS PPT 2.pptx
Advance C Programming UNIT 4-FILE HANDLING IN C.pdf
File Organization
Ad

Recently uploaded (20)

PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
history of c programming in notes for students .pptx
PPTX
Transform Your Business with a Software ERP System
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
AI in Product Development-omnex systems
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
wealthsignaloriginal-com-DS-text-... (1).pdf
Softaken Excel to vCard Converter Software.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Understanding Forklifts - TECH EHS Solution
history of c programming in notes for students .pptx
Transform Your Business with a Software ERP System
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PTS Company Brochure 2025 (1).pdf.......
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Internet Downloader Manager (IDM) Crack 6.42 Build 41
CHAPTER 2 - PM Management and IT Context
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Navsoft: AI-Powered Business Solutions & Custom Software Development
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
2025 Textile ERP Trends: SAP, Odoo & Oracle
Reimagine Home Health with the Power of Agentic AI​
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
AI in Product Development-omnex systems
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx

Android APP-toggle case

  • 1. import java.io.*; class BufferTest { public static void main(String args[]){ //creat stream FileReader fileReader = null; BufferedReader bufferedReader = null; FileWriter fileWriter = null; BufferedWriter bufferedWriter = null; String line = null; try{ //acquire origin file address fileReader = new FileReader("f:/excise/Stream/zzz.txt"); //output path of generated file fileWriter = new FileWriter("f:/excise/Stream/aaa.txt"); //write buffer stream bufferedReader = new BufferedReader(fileReader); //write buffer stream bufferedWriter = new BufferedWriter(fileWriter); //read data iteratively while(true){ //read one line data line = bufferedReader.readLine(); if(line == null){ break; } String str = line.toUpperCase();//to uppercase //String str = line.toLowerCase(); to lowercase //output buffer stream bufferedWriter.write(str); //change line bufferedWriter.newLine(); } } catch(Exception e){ System.out.println(e); }finally{ try{ //close stream fileReader.close(); bufferedReader.close(); bufferedWriter.close(); fileWriter.close(); } catch(Exception e){ System.out.println(e); } } } }