Package com.google.gson.internal
Class Streams.AppendableWriter
- java.lang.Object
-
- java.io.Writer
-
- com.google.gson.internal.Streams.AppendableWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
- Enclosing class:
- Streams
private static final class Streams.AppendableWriter extends java.io.Writer
Adapts anAppendable
so it can be passed anywhere aWriter
is used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Streams.AppendableWriter.CurrentWrite
A mutable char sequence pointing at a single char[].
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Appendable
appendable
private Streams.AppendableWriter.CurrentWrite
currentWrite
-
Constructor Summary
Constructors Constructor Description AppendableWriter(java.lang.Appendable appendable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Writer
append(java.lang.CharSequence csq)
java.io.Writer
append(java.lang.CharSequence csq, int start, int end)
void
close()
void
flush()
void
write(char[] chars, int offset, int length)
void
write(int i)
void
write(java.lang.String str, int off, int len)
-
-
-
Field Detail
-
appendable
private final java.lang.Appendable appendable
-
currentWrite
private final Streams.AppendableWriter.CurrentWrite currentWrite
-
-
Method Detail
-
write
public void write(char[] chars, int offset, int length) throws java.io.IOException
- Specified by:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
flush
public void flush()
- Specified by:
flush
in interfacejava.io.Flushable
- Specified by:
flush
in classjava.io.Writer
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classjava.io.Writer
-
write
public void write(int i) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(java.lang.String str, int off, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
append
public java.io.Writer append(java.lang.CharSequence csq) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Overrides:
append
in classjava.io.Writer
- Throws:
java.io.IOException
-
append
public java.io.Writer append(java.lang.CharSequence csq, int start, int end) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Overrides:
append
in classjava.io.Writer
- Throws:
java.io.IOException
-
-