#Java I/O Depth of Understanding

1 messages · Page 1 of 1 (latest)

solemn eagle
#

Hello, I hope whoever is reading is doing well. I am currently reading the book "Java: A Beginner's Guide, 9th Edition". One of the chapters goes into Java's input-output functionality. After giving it a read through, I am sadly unable to understand and grasp the concept of I/O. The self test at the end of the section further pushed this fact to me (difficulty constructing an object of subclass outputstream, reading text data from a file). This has brought a few concerns which I would like help clearing up:

How essential is a good understanding of java I/O? Before I move on, should I take the time to learn this concept better, or would it be more beneficial to look back on it later? And if I am to learn now, should it be in-depth (like a book), or supplemental (articles, and youtube videos)? I am still a beginner, and the next part of the book is covering multithreading. Thank you for your time.

rustic warrenBOT
#

<@&987246399047479336> please have a look, thanks.

#

Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#
TJ-Bot
Hello, I hope whoever is reading is doing well. I am currently reading the book "Java: A Beginner's Guide, Ninth Edition, 9th Edition". One of the chapters goes into Java's input-output functionality. After giving it a read through, I am sadly unable to un

va Input and Output (I/O) which covers file handling, streams, and serialization. I am struggling to fully understand the concept of streams in Java I/O.

I know that streams are used to transfer data between a program and an input/output device such as a file or network connection. There are two types of streams in Java: byte streams and character streams. Byte streams are used for inputting and outputting raw binary data, while character streams are used for inputting and outputting text data.

I am having trouble grasping how to effectively use different stream classes like FileInputStream, FileOutputStream, DataInputStream, DataOutputStream, and BufferedInputStream. I am also confused about when to use buffered streams for improved performance.

I would appreciate it if someone could provide some examples or explanations on how to effectively use these stream classes in Java I/O. Additionally, any tips or best practices on handling files in Java would be greatly helpful.

Thank you in advance for any assistance provided.

stoic tinsel
#

however, there may be times where you need more control in how the file is read. so it really depends on your needs, whether its worth diving into

#

same applies for concepts like sockets. there are higher-level libraries & such that you can use to side-step the complexity

#

an example being HttpClient. no need to learn how to use the Socket API if all you need is a simple http client

#

id recommend you study the chapter, but if you're more eager to jump intp multithreading, then go for that instead

solemn eagle
#

I will take your advice, and read into the subject more thoroughly

#

I won't go too, gun-ho into it, like reading a book (I found Java I/O, 2nd Edition to look quite interesting)

#

but I will read a few articles

#

thank you for your help

solemn eagle
#

it was mentioned in the book as a newer version of the process

stoic tinsel
#

its good to understand things like the c10k problem. but the chances of you actually using ServerSocketChannel and such are pretty low

solemn eagle
#

Perfect, thank you again for your help

#

I appreciate it