This document discusses input/output streams and files in Java. It describes input streams, which read data from sources like keyboards or files, and output streams, which write data to destinations like monitors or files. It then focuses on reading and writing files using FileInputStream, FileOutputStream, FileReader and FileWriter classes. Constructors and methods of each class are listed, with examples provided of reading and writing files byte-by-byte and character-by-character. The key difference between byte and character streams is also summarized.
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods. Subclasses of an abstract class in Python are not required to implement abstract methods of the parent class.
A package allows a developer to group classes (and interfaces) together. These classes will all be related in some way – they might all have to do with a specific application or perform a specific set of tasks.
This document provides relevant and useful information about Java strings. It covers a brief description about strings and how to create a string in Java. It also covers detailed information on String, StringBuffer, and StringBuilder classes and differences between them.
An enumeration (enum) is a user-defined type (same as structure) that represents a group of constants. typedef is a keyword used to create alias name for the existing datatypes.
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods. Subclasses of an abstract class in Python are not required to implement abstract methods of the parent class.
A package allows a developer to group classes (and interfaces) together. These classes will all be related in some way – they might all have to do with a specific application or perform a specific set of tasks.
This document provides relevant and useful information about Java strings. It covers a brief description about strings and how to create a string in Java. It also covers detailed information on String, StringBuffer, and StringBuilder classes and differences between them.
An enumeration (enum) is a user-defined type (same as structure) that represents a group of constants. typedef is a keyword used to create alias name for the existing datatypes.
At the end of this lecture students should be able to;
Define the C standard functions for managing file input output.
Apply taught concepts for writing programs.
Vaccine management system project report documentation..pdfKamal Acharya
The Division of Vaccine and Immunization is facing increasing difficulty monitoring vaccines and other commodities distribution once they have been distributed from the national stores. With the introduction of new vaccines, more challenges have been anticipated with this additions posing serious threat to the already over strained vaccine supply chain system in Kenya.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Quality defects in TMT Bars, Possible causes and Potential Solutions.PrashantGoswami42
Maintaining high-quality standards in the production of TMT bars is crucial for ensuring structural integrity in construction. Addressing common defects through careful monitoring, standardized processes, and advanced technology can significantly improve the quality of TMT bars. Continuous training and adherence to quality control measures will also play a pivotal role in minimizing these defects.
Event Management System Vb Net Project Report.pdfKamal Acharya
In present era, the scopes of information technology growing with a very fast .We do not see any are untouched from this industry. The scope of information technology has become wider includes: Business and industry. Household Business, Communication, Education, Entertainment, Science, Medicine, Engineering, Distance Learning, Weather Forecasting. Carrier Searching and so on.
My project named “Event Management System” is software that store and maintained all events coordinated in college. It also helpful to print related reports. My project will help to record the events coordinated by faculties with their Name, Event subject, date & details in an efficient & effective ways.
In my system we have to make a system by which a user can record all events coordinated by a particular faculty. In our proposed system some more featured are added which differs it from the existing system such as security.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
Democratizing Fuzzing at Scale by Abhishek Aryaabh.arya
Presented at NUS: Fuzzing and Software Security Summer School 2024
This keynote talks about the democratization of fuzzing at scale, highlighting the collaboration between open source communities, academia, and industry to advance the field of fuzzing. It delves into the history of fuzzing, the development of scalable fuzzing platforms, and the empowerment of community-driven research. The talk will further discuss recent advancements leveraging AI/ML and offer insights into the future evolution of the fuzzing landscape.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
2. I/O Stream
Input Stream: It is a stream which may be
connected with different i/p devices like
keyboard, file or network socket. It is used to
generate data.
Output Stream: It is used to produce data and
may be connected with different output devices
like monitor, file, network socket.
3. Files and Streams
File processing with classes in package java.io
FileInputStream for
byte-by-byte input from a file
FileOutputStream for
byte-by-byte output to a file
FileReader for char-by-char
input from a file
FileWriter for char-by-char
output to a file
4. Difference
byte Stream char Stream
1. It deals with byte.
2. Used to manipulate
data in binary
format.
3. Mainly uses audio,
video, img, txt files.
4. InputStream and
OutputStream are
top two abstract
classes of byte
Stream.
1. It deals with char or
Strings.
2. Used to manipulate
data in Unicode.
3. Can be used only
with txt files.
4. Reader & Writer are
top two abstract
classes of char
Stream.
6. Constructors, Methods Of
FileInputStream
CONSTRUCTORS:
FileInputStream(String fname);
FileInputStream(File F);
FileInputStream(String fold, String fname);
METHODS:
int read(); // n= fis.read(); // n is the byte read.
7. Constructors, Methods Of
FileOutputStream
CONSTRUCTORS:
FileOutputStream(String fname);
FileOutputStream(File F);
FileOutputStream(String fname, boolean app);
METHODS:
void write(int n); //write(n); //n is the byte to be
written
void write(byte []b); // writes the array contents to
file.
8. Example: FileInputStream
import java.io.*;
public class ReadStringFromFile {
public static void main(String[] args)
{
File file = new File("C://FileIO//ReadString.txt");
int ch;
StringBuffer strContent = new StringBuffer("");
FileInputStream fin = null;
try
{
fin = new FileInputStream(file);
13. Constructors, Methods Of FileReader
CONSTRUCTORS:
FileReader(String fname);
FileReader(File F);
FileReader(String fold, String fname);
METHODS:
int read(); // n= fis.read(); // n is the char read.
int read(char [] c, int offset, int len); // reads
character into an array and returns the number of
chars read.
14. Constructors, Methods Of FileWriter
CONSTRUCTORS:
FileWriter(String fname);
FileWriter(File F);
FileWriter(String fold, String fname);
METHODS:
void write(String n); // write(n); //n is the String to be
written to file.
public void write(char [] c, int offset, int len); // Writes a
portion of an array of characters starting from offset
and with a length of len.
public void write(String s, int offset, int len);
15. Example: FileReader
import java.io.*;
public class FileRead {
public static void main(String args[]) throws
IOException {
File file = new File("Hello1.txt");
file.createNewFile(); //returns true if file is created
FileWriter fw = new FileWriter(file);
fw.write("Thisn isn ann examplen");
fw.flush();
fw.close();
16. Continue...
FileReader fr = new FileReader(file);
char [] a = new char[50];
fr.read(a); //reads content to array
for(char c : a)
System.out.print(c);
fr.close(); }
}
17. Example: FileReader using
BufferedReader
import java.io.*;
public class Reader {
public static void main(String[]args) throws
IOException{
FileReader fr = new FileReader("C:/test.txt");
BufferedReader br = new BufferedReader(in);
while (br.readLine() != null)
{ System.out.println(br.readLine()); }
fr.close();
}