Download presentation
Presentation is loading. Please wait.
1
SE-1021 Software Engineering II
4/11/2019 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 not already submitted) Thursday Quiz at start of lab Dr. Yoder
2
Slide style: Dr. Hornick
SE1021 4/11/2019 Exam If you believe that I made a mistake in counting points or similar, please ask me If you believe that I took off too many points or incorrectly said that you made a mistake, send me a signed document (e.g. ) explaining why you deserve more points If you would like a “second chance” to show you know something, let me know after class. 10pts max, I will announce if there is interest If you believe that I made a mistake in counting points or similar, please notify If you believe that I took off too many points or incorrectly said that you made a mistake, send me a signed document (e.g. from your MSOE account) explaining why you deserve more points If you would like a chance to show that you actually knew something, let me know after class. 10pts max, will announce details to whole class if there is interest SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick Dr. Yoder
3
Creating Diagrams in EA
Look for: se ImportingCodeIntoEA.docx SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick
4
Slide style: Dr. Hornick
Exercises How many bits are there in a byte? How many values can you encode with a single byte? SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick
5
Slide style: Dr. Hornick
ASCII table First digit LF – Line feed (\n) 0xA CR – carriage return (\r) 0xD Second digit SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick
6
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
7
Slide style: Dr. Hornick
Files A file is a sequence of bytes stored on the computer 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
8
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
9
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. 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
10
Slide style: Dr. Hornick
SE1021 4/11/2019 Your turn! Use FileReader to read a file. Use reader.read() to read a character from the file Print the characters on the screen. SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick Dr. Yoder
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.