File tree Expand file tree Collapse file tree
miniterm-ffm/src/main/java/org/codejive/miniterm
miniterm/src/main/java/org/codejive/miniterm Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 * <p>This interface abstracts the low-level terminal operations that differ between Unix
1515 * (Linux/macOS) and Windows platforms.
1616 */
17- public interface Terminal extends AutoCloseable {
17+ public interface Terminal extends Appendable , AutoCloseable {
1818
1919 /**
2020 * Enables raw mode on the terminal.
@@ -88,6 +88,24 @@ public interface Terminal extends AutoCloseable {
8888 */
8989 void write (String s ) throws IOException ;
9090
91+ @ Override
92+ default Appendable append (char c ) throws IOException {
93+ write (new byte [] {(byte ) c });
94+ return this ;
95+ }
96+
97+ @ Override
98+ default Appendable append (CharSequence csq ) throws IOException {
99+ write (csq .toString ());
100+ return this ;
101+ }
102+
103+ @ Override
104+ default Appendable append (CharSequence csq , int start , int end ) throws IOException {
105+ write (csq .subSequence (start , end ).toString ());
106+ return this ;
107+ }
108+
91109 /**
92110 * Returns the charset used for terminal I/O.
93111 *
Original file line number Diff line number Diff line change 1414 * <p>This interface abstracts the low-level terminal operations that differ between Unix
1515 * (Linux/macOS) and Windows platforms.
1616 */
17- public interface Terminal extends AutoCloseable {
17+ public interface Terminal extends Appendable , AutoCloseable {
1818
1919 /**
2020 * Enables raw mode on the terminal.
@@ -88,6 +88,24 @@ public interface Terminal extends AutoCloseable {
8888 */
8989 void write (String s ) throws IOException ;
9090
91+ @ Override
92+ default Appendable append (char c ) throws IOException {
93+ write (new byte [] {(byte ) c });
94+ return this ;
95+ }
96+
97+ @ Override
98+ default Appendable append (CharSequence csq ) throws IOException {
99+ write (csq .toString ());
100+ return this ;
101+ }
102+
103+ @ Override
104+ default Appendable append (CharSequence csq , int start , int end ) throws IOException {
105+ write (csq .subSequence (start , end ).toString ());
106+ return this ;
107+ }
108+
91109 /**
92110 * Returns the charset used for terminal I/O.
93111 *
You can’t perform that action at this time.
0 commit comments