SE-1021 Software Engineering II Week 9, Class 3 Get ready for PollEverywhere! BlocksMania and File I/O Reading/Writing text in ASCII, Unicode, and UTF-8.

Slides:



Advertisements
Similar presentations
A Guide to Advanced Java Faculty:Nguyen Ngoc Tu. 2 Operating System Application #1 Application #2 Java Virtual Machine #1 Local Memory Shared Memory Threads.
Advertisements

Chapter 19 Binary I/O.
Exceptions. Definition Exception: something unexpected that can occur in the execution of a program e.g., divide by zero or attempt to open a file that.
The Package Statement Group related interfaces and classes together Purpose: encapsulation and reduces name conflicts –private package classes not visible.
Streams Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 12 File Input and Output.
File input and output. Interactive vs. file I/O All of the programs we have seen or written thus far have assumed interaction with a user, who types in.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Chapter 12 File Input and Output.
Lecture 31 File I/O -Part 2 COMP1681 / SE15 Introduction to Programming.
File Input and Output Recitation 04/03/2009 CS 180 Department of Computer Science, Purdue University.
 We can use a combination of the File and FileOutputStream to write a series of bytes to a file.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 12  File Input and Output Stream Classes Text Input and Output.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L07 (Chapter 18) Binary I/O.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 18 Binary I/O.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Chapter 12 File Input and Output.
CS102--Object Oriented Programming Lecture 14: – File I/O BufferedReader The File class Write to /read from Binary files Copyright © 2008 Xiaoyan Li.
Chapter 12 File Input and Output. Topics Stream Classes Files Text Input and Output JFileChooser for GUI programs Binary files.
Aloha Aloha What you see: What the computer sees: binary number columns binary number columns
CIS 270—Application Development II Chapter 14—Files and Streams.
SE-1021 Software Engineering II Week 5, Class SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick 1.
Streams Reading: 2 nd Ed: , rd Ed: 11.1, 19.1, 19.4
JAVA I/O © EnhanceEdu, IIIT Hyderabad. Contents 3/29/2010EnhanceEdu, IIIT - H 2  Command Line I/O  File Class  Streams  Byte Streams [Low level and.
CS2910 Week 1, Class 3 Today Lab 1 – Additional Assignment Working Ahead Primitives in Java SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder.
SE1011 Week 2, Class 3 Today Compiling and running Another example using Scanner Compile-time and Run-time errors Review for exam SE-1011 Slide design:
SE-1021 Software Engineering II Week 8, Class 1 Return Exam Producing UML diagrams automatically in EA Poll Everywhere Files Tomorrow Week 6 HW due (if.
SE-1021 Software Engineering II Week 5, Class 2 Why my computer crashed Layouts Multiple action listeners Single actionPerformed method – distinguishing.
By Rachel Thompson and Michael Deck.  Java.io- a package for input and output  File I/O  Reads data into and out of the console  Writes and reads.
SE-1021 Software Engineering II Week 5, Class 1 Learning Resources From inner classes to anonymous Inner Classes Additional GUI components Inheritance.
CS2910 Week 1, Class 2 Today Announce Prof. Michael Vieau’s S-341 6p Thurs Wk 2 Assignment for tomorrow Data Encoding, Part 1 Parsing Data Muddiest Point.
Data Files on Computers Text Files (ASCII) Files that can be created by typing on the keyboard while using a text editor such as notepad or TextEdit.
CIS 270—App Dev II Big Java Chapter 19 Files and Streams.
SE-1021 Software Engineering II Week 1, Day 2 Attendance Survey results: Use powerpoint Safety Review Preparation for Lab 1 More on Java fundamentals…
SE-1021 Software Engineering II Week 1, Day 2 Attendance Survey results: Use powerpoint Safety Review Preparation for Lab 1 More on Java fundamentals…
1 Chapter 19 Binary I/O. 2 Motivations F Data stored in a text file – is represented in human-readable form –Text file –Readable –Java source programs.
CS2910 Week 2, Class 1 Today Return Lab 1 Muddiest Points Quiz Parsing Data in Python SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
SE1011 Week 3, Class 2 Today Sit down by someone you don't know Learn their name Find out who came farther to get to MSOE at the start of the quarter Designing.
CS2910 Week 4, Class 1 Today Encoding in Python – Review Quiz – Encoding in Python Introduction to HTTP SE-2811 Slide design: Dr. Mark L. Hornick Content:
Week 7, Class 1: The Command Pattern (cont.) Get Ready for Poll Everywhere Labs 2 & 3 returned Lab 7 due this evening at 11pm Quiz tomorrow at start of.
CS2910 Week 8, Class 2 Today Return Quiz Look at Schedule TCP implementation! Week 8, Monday Quiz on SMTP May include some questions requiring you to interpret.
Java Input / Output l a modular approach to input/output: - different stream objects are connected/wrapped to handle I/O l a data stream object: a flow.
Recitation File I/O. File I/O File inFile = new File("data.txt"); File inFile = new File (“/Users/sunil/test.txt");
CSG2H3 Object Oriented Programming
BINARY I/O IN JAVA CSC 202 November What should be familiar concepts after this set of topics: All files are binary files. The nature of text files.
Java Text I/O CS140 Dick Steflik. Reader Abstract super class for character based input Subclasses: – BufferedReader – CharArrayReader – FilterReader.
Slide design: Dr. Mark L. Hornick
Slide style: Dr. Hornick
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Chapter 17 Binary I/O.
SE-1021 Software Engineering II
Slide design: Dr. Mark L. Hornick
Chapter 17 Binary I/O 1.
Chapter 17 Binary I/O Dr. Clincy - Lecture.
JAVA IO.
MSIS 670: Object-Oriented Software Engineering
SE-1021 Software Engineering II
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1021 Software Engineering II
Slide design: Dr. Mark L. Hornick
CS2911 Week 2, Class 3 Today Return Lab 2 and Quiz 1
SE-1021 Software Engineering II
CS 240 – Advanced Programming Concepts
SE-1021 Software Engineering II
SE-1021 Software Engineering II
Slide design: Dr. Mark L. Hornick
SE-1021 Software Engineering II
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1021 Software Engineering II
David Davenport Spring 2005
SE-1021 Software Engineering II
Presentation transcript:

SE-1021 Software Engineering II Week 9, Class 3 Get ready for PollEverywhere! BlocksMania and File I/O Reading/Writing text in ASCII, Unicode, and UTF-8 Reading/Writing binary data Handy tool for finding files 1

HW See hw/ on web web.msoe.edu/yoder/se1021/hw/ web.msoe.edu/yoder/se1021/hw/ SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick 2

PollEverywhere Responses PollEverywhere responses for the last lecture are available at slides/se pollEverywhereResponsesslides/se pollEverywhereResponses Shows what I see for non-anonymous questions SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick 3

Useful Resources JOptionPane advanced features Dean & Dean, pp JFileChooser (D&D, pp ) JDialog For creating a more advanced “JOptionPane” (e.g. with multiple fields) javax.swing.Timer For having regularly-repeating events (or other timed events) SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick 4

Editing binary files Check out Be.HexEdit SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick 5

File I/O (1) Low-level file I/O for raw byte I/O, similar to System.in.read() and System.out.write() FileInputStream — reads raw bytes FileInputStream FileOutputStream — writes raw bytes FileOutputStream Text file I/O for I/O of text Scanner - reads & parses text (provides readLine) Scanner PrintWriter - writes text PrintWriter Text file I/O (alternate, perhaps more complicated) BufferedReader - Provides readLine 6

File I/O (2) High-level file I/O for I/O of primitive data types DataInputStream — reads primitive data types DataInputStream DataOutputStream — writes primitive data types DataOutputStream Object file I/O for I/O of arbitrary object data ObjectInputStream — reads arbitrary object data ObjectInputStream ObjectOutputStream — writes arbitrary object data ObjectOutputStream SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick 7

SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick 8

BlocksMania load-level GameBoard class (See example) Simple tile class SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick 9

BlocksMania Tile SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick 10 [TODO: How to prep this question?] Since the type will be the same for every object from the Tile class, can you think of a better way to store this information?

Consider this code: for(int col = 0; col<numCols && col<line.length()+1; col++) { c = line.charAt(col+1); } How can we fix this to skip the first character, and have col line up with the column headers? SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick 11

SE-2811 Dr. Josiah Yoder Slide style: Dr. Hornick 12 DO ONLINE: PollEv.com/ yoderj