Download presentation
Presentation is loading. Please wait.
Published byEsmond Taylor Modified over 9 years ago
1
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 1
2
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. email) 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 SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick 2
3
Creating Diagrams in EA https://faculty- web.msoe.edu/yoder/se1021/slides/ https://faculty- web.msoe.edu/yoder/se1021/slides/ Look for: se1021-8-1-ImportingCodeIntoEA.docx https://faculty- web.msoe.edu/yoder/se1021/slides/se1021-8- 1-ImportingCodeIntoEA.docx SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick 3
4
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 4
5
ASCII table LF – Line feed (\n) 0xA CR – carriage return (\r) 0xD SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick 5 http://ascii-table.com/img/ascii-table.gif Second digit First digit
6
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 6
7
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 7
8
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 8
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 9
10
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 10
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.