GeezerVison is showing docs.oracle.com — StringWriter (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
compact1, compact2, compact3
java.io
Class StringWriter
-
-
Constructor Summary
Constructors
| Constructor |
Description |
StringWriter() |
Create a new string writer using the default initial string-buffer
size.
|
StringWriter(int initialSize) |
Create a new string writer using the specified initial string-buffer
size.
|
-
Method Summary
All Methods Instance Methods Concrete Methods
| Modifier and Type |
Method |
Description |
StringWriter |
append(char c) |
Appends the specified character to this writer.
|
StringWriter |
append(CharSequence csq) |
Appends the specified character sequence to this writer.
|
StringWriter |
append(CharSequence csq,
int start,
int end) |
Appends a subsequence of the specified character sequence to this writer.
|
void |
close() |
Closing a StringWriter has no effect.
|
void |
flush() |
Flush the stream.
|
StringBuffer |
getBuffer() |
Return the string buffer itself.
|
String |
toString() |
Return the buffer's current value as a string.
|
void |
write(char[] cbuf,
int off,
int len) |
Write a portion of an array of characters.
|
void |
write(int c) |
Write a single character.
|
void |
write(String str) |
Write a string.
|
void |
write(String str,
int off,
int len) |
Write a portion of a string.
|
-
-
Method Detail
-
write
public void write(char[] cbuf,
int off,
int len)
Write a portion of an array of characters.
- Specified by:
write in class Writer
- Parameters:
cbuf - Array of characters
off - Offset from which to start writing characters
len - Number of characters to write
-
write
public void write(String str,
int off,
int len)
Write a portion of a string.
- Overrides:
write in class Writer
- Parameters:
str - String to be written
off - Offset from which to start writing characters
len - Number of characters to write
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|