类 StringBuilderWriter
java.lang.Object
java.io.Writer
com.alibaba.cloud.commons.io.StringBuilderWriter
- 所有已实现的接口:
Closeable,Flushable,Serializable,Appendable,AutoCloseable
Copy from apache commons-io.
-
字段概要
-
构造器概要
构造器构造器说明Constructs a newStringBuilderinstance with default capacity.StringBuilderWriter(int capacity) Constructs a newStringBuilderinstance with the specified capacity.StringBuilderWriter(StringBuilder builder) Constructs a new instance with the specifiedStringBuilder. -
方法概要
修饰符和类型方法说明append(char value) Appends a single character to this Writer.append(CharSequence value) Appends a character sequence to this Writer.append(CharSequence value, int start, int end) Appends a portion of a character sequence to theStringBuilder.voidclose()Closing this writer has no effect.voidflush()Flushing this writer has no effect.Returns the underlying builder.toString()ReturnsStringBuilder.toString().voidwrite(char[] value, int offset, int length) Writes a portion of a character array to theStringBuilder.voidWrites a String to theStringBuilder.从类继承的方法 java.io.Writer
nullWriter, write, write, write
-
构造器详细资料
-
StringBuilderWriter
public StringBuilderWriter()Constructs a newStringBuilderinstance with default capacity. -
StringBuilderWriter
public StringBuilderWriter(int capacity) Constructs a newStringBuilderinstance with the specified capacity.- 参数:
capacity- The initial capacity of the underlyingStringBuilder
-
StringBuilderWriter
Constructs a new instance with the specifiedStringBuilder.If
builderis null a new instance with default capacity will be created.- 参数:
builder- The String builder. May be null.
-
-
方法详细资料
-
append
Appends a single character to this Writer.- 指定者:
append在接口中Appendable- 覆盖:
append在类中Writer- 参数:
value- The character to append- 返回:
- This writer instance
-
append
Appends a character sequence to this Writer.- 指定者:
append在接口中Appendable- 覆盖:
append在类中Writer- 参数:
value- The character to append- 返回:
- This writer instance
-
append
Appends a portion of a character sequence to theStringBuilder.- 指定者:
append在接口中Appendable- 覆盖:
append在类中Writer- 参数:
value- The character to appendstart- The index of the first characterend- The index of the last character + 1- 返回:
- This writer instance
-
close
public void close()Closing this writer has no effect. -
flush
public void flush()Flushing this writer has no effect. -
write
Writes a String to theStringBuilder. -
write
public void write(char[] value, int offset, int length) Writes a portion of a character array to theStringBuilder. -
getBuilder
Returns the underlying builder.- 返回:
- The underlying builder
-
toString
ReturnsStringBuilder.toString().
-