Stay organized with collections
Save and categorize content based on your preferences.
AI-generated Key Takeaways
Readable is an interface defining a source of characters, providing them through a CharBuffer.
It features a primary method, read(), to attempt reading characters into a designated CharBuffer.
read() returns the count of characters added or -1 if the source is exhausted, potentially throwing exceptions like IOException, NullPointerException, or ReadOnlyBufferException.
Attempts to read characters into the specified character buffer.
The buffer is used as a repository of characters as-is: the only
changes made are the results of a put operation. No flipping or
rewinding of the buffer is performed.
Parameters
cb
the buffer to read characters into
Returns
The number of char values added to the buffer,
or -1 if this source of characters is at its end
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[],["The `Readable` interface represents a source of characters. It defines a `read` method, which attempts to populate a provided `CharBuffer` with characters. The method returns the number of characters added or -1 if the end of the character source is reached. The `read` method does not change the buffer’s position, only adds to it. Several indirect subclasses, including `BufferedReader`, `FileReader`, and `StringReader`, implement `Readable`. It throws specific exceptions for I/O errors, null buffers, or read-only buffers.\n"]]