public class ByteStringWriter extends Writer
Constructor and Description |
---|
ByteStringWriter(ByteStringAppender out)
Constructs a new ByteStringWriter with the provided ByteStringAppender.
|
Modifier and Type | Method and Description |
---|---|
@NotNull Writer |
append(char c)
Appends a single character.
|
@NotNull Writer |
append(@NotNull CharSequence csq)
Appends a character sequence.
|
@NotNull Writer |
append(@NotNull CharSequence csq,
int start,
int end)
Appends a portion of a character sequence.
|
void |
close()
Closes the writer, flushing it first.
|
void |
flush()
Flushes the stream.
|
void |
write(char[] cbuf,
int off,
int len)
Writes a portion of an array of characters.
|
void |
write(int c)
Writes a single character.
|
void |
write(@NotNull String str)
Writes a string.
|
void |
write(@NotNull String str,
int off,
int len)
Writes a portion of a string.
|
public ByteStringWriter(ByteStringAppender out)
out
- The ByteStringAppender to be used.IllegalStateException
- if the input ByteStringAppender is released.public void write(int c) throws IOException
write
in class Writer
c
- int specifying a character to be written.IOException
- if an I/O error occurs.public void write(@NotNull @NotNull String str) throws IOException
write
in class Writer
str
- String to be written.IOException
- if an I/O error occurs.public void write(@NotNull @NotNull String str, int off, int len) throws IOException
write
in class Writer
str
- String to be written.off
- Offset from which to start reading characters.len
- Number of characters to be written.IOException
- if an I/O error occurs.@NotNull public @NotNull Writer append(@NotNull @NotNull CharSequence csq) throws IOException
append
in interface Appendable
append
in class Writer
csq
- The character sequence to append.IOException
- if an I/O error occurs.@NotNull public @NotNull Writer append(@NotNull @NotNull CharSequence csq, int start, int end)
append
in interface Appendable
append
in class Writer
csq
- The character sequence to append.start
- The index of the first character to append.end
- The index of the character following the last character to append.@NotNull public @NotNull Writer append(char c)
append
in interface Appendable
append
in class Writer
c
- The character to append.public void flush()
public void close()
public void write(char[] cbuf, int off, int len) throws IOException
write
in class Writer
cbuf
- Array of characters.off
- Offset from which to start reading characters.len
- Number of characters to be written.IOException
- if an I/O error occurs.Copyright © 2023. All rights reserved.