SE-1021 Software Engineering II

Slides:



Advertisements
Similar presentations
Jan Java I/O Yangjun Chen Dept. Business Computing University of Winnipeg.
Advertisements

Introduction to Java 2 Programming Lecture 7 IO, Files, and URLs.
Lecture 15: I/O and Parsing
Java File I/O. File I/O is important! Being able to write and read from files is necessary and is also one common practice of a programmer. Examples include.
CIS 234: Character Codes Dr. Ralph D. Westfall April, 2011.
Java Programming: I/O1 Java I/O Reference: java.sun.com/docs/books/tutorial/essential/io/
CS-280 Dr. Mark L. Hornick 1 ASCII table. 2 Displaying Numbers as Text Problem: display numerical values as text Consider the numerical value 0x5A held.
Aloha Aloha What you see: What the computer sees: binary number columns binary number columns
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.
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.
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.
CS2910 Week 1, Class 1 Today Introductions Class/Lab Layout Safety Review - Note about Lab Safety Review Announce Prof. Michael Vieau’s S-341 6p Thurs.
CS-2852 Data Structures Week 5, Class 1 – Testing and Stacks Return Exams & Labs  Package-level access  UML connectors for instance variables Announcement:
CS-2852 Data Structures Week 5, Class 2 – Testing and Stacks Announcement: Lab Demos - 2/3 & 4 on Friday Testing  Definitions, Example  (tentative) Testing.
© Amir Kirsh Files and Streams in Java Written by Amir Kirsh.
Chapter 14: Files and Streams. 2Microsoft Visual C# 2012, Fifth Edition Files and the File and Directory Classes Temporary storage – Usually called computer.
CS2910 Week 2, Class 1 Today Data Encoding, Part 1 Parsing Data Python Muddiest Point Lab 2 – Bring text In Class, Thursday: Quiz Week 6, Monday: Midterm.
CS2852 Week 3, Class 2 Today Stacks Queues SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
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…
OFF = 0 ON = 1 = 63 BINARY system
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:
CS2852 Week 7, Class 1 Today Binary Search Tree Implementing add Implementing find Return Quiz 4 (second attempt) Both sections are graded SE-2811 Slide.
ISNE101 – Introduction to Information Systems & Network Engineering WEEK 2.
Binary 101 Gads Hill School. Aim To strengthen understanding of how computers use the binary number system to store information.
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.
Week 6, Class 3: Composite Swing composites File composites Computer composites SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
SE3910 Week 8, Class 2 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 7, Class 2 (Wednesday) Half-Exam 2 Done.
CS-2852 Data Structures Week 5, Class 3 – Testing and Recursion Queue Implementing finite queues Binary Search Recursion Tomorrow – Quiz, Lab demos, Lab.
1.4 Representation of data in computer systems Character.
Keerthi Nelaturu Url: site.uottawa.ca/~knela006
Data Representation COE 308 Computer Architecture
Data Representation ICS 233
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Data Transfer ASCII FILES.
Reading Netpbm Images.
Slide design: Dr. Mark L. Hornick
Representing Information as bit patterns
I/O Basics.
Data Encoding Characters.
Data Representation COE 301 Computer Organization
Chapter 17 Binary I/O Dr. Clincy - Lecture.
Computers & Programming Languages
Slide design: Dr. Mark L. Hornick
JAVA IO.
SE-1021 Software Engineering II
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Data Representation ICS 233
Learning Intention I will learn how computers store text.
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
SE-1021 Software Engineering II
CS-2852 Data Structures Week 1, Class 1 Data Structures Syllabus
SE-1021 Software Engineering II
CS2911 Week 3, Lab Today Thursday Friday Review Muddiest Point Lab 3
SE-1021 Software Engineering II
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
SE-1021 Software Engineering II
SE-1011 Slide design: Dr. Mark L. Hornick Instructor: Dr. Yoder
Data Representation COE 308 Computer Architecture
SE-1021 Software Engineering II
Presentation transcript:

SE-1021 Software Engineering II 7/29/2018 SE-1021 Software Engineering II Week 9, Day 2 Exceptions (briefly) Files Bits and Bytes Week 9, Day 3 Lab 8 Complete Demo Lab 9: Start writing/reading bmsoe files SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick Dr. Josiah Yoder

To catch individually, what order? Exception IllegalArgumentException IOException NumberFormatException RuntimeException SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick

Slide style: Dr. Hornick … } catch ( ) { } catch ( ) { } SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick

Slide style: Dr. Hornick Review / New Material How many bits are there in a byte? Write all the three-bit binary numbers. How many values can you encode with a single byte? SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick

Slide style: Dr. Hornick ASCII table First digit LF – Line feed (\n) 0x0A CR – carriage return (\r) 0x0D Second digit SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick http://ascii-table.com/img/ascii-table.gif

Slide style: Dr. Hornick ASCII How many bytes do you need to store one ASCII character? How many bits do you need to store one ASCII character? SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick

Slide style: Dr. Hornick Files A file is a container for a sequence of bytes stored on the computer’s hard drive Each byte is made up of 8 bits An ASCII character is one way of storing letters. “Plain text files” often use ANSI ASCII encoding. To encode other languages, we need to use a different encoding. SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick

Slide style: Dr. Hornick Using files in Java Both files and folders (Directories) are represented with a “Path” object as discussed earlier We can open the file to get the byte stream (Coding example) Path path = Paths.get(…); boolean isDir = Files.isDirectory(path); SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick

Reading the bytes from a file InputStream is an abstract class to represent reading bytes FileInputStream is a class that reads bytes from a file You can also get input streams to read bytes from the network, a byte array, etc. Use inputStream.read() to read one byte Returns -1 (an integer) if the byte is not read Use inputStream.read(…) to read multiple bytes at a time SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick