Package aQute.lib.json
Class Encoder
- java.lang.Object
-
- aQute.lib.json.Encoder
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
public class Encoder extends java.lang.Object implements java.lang.Appendable, java.io.Closeable, java.io.Flushable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Appendable
append(char c)
java.lang.Appendable
append(java.lang.CharSequence sq)
java.lang.Appendable
append(java.lang.CharSequence sq, int start, int length)
Encoder
charset(java.lang.String encoding)
Encoder
charset(java.nio.charset.Charset encoding)
void
close()
Encoder
deflate()
byte[]
digest()
void
flush()
Encoder
indent(java.lang.String tabs)
Encoder
keepOpen()
Encoder
mark()
Encoder
put(java.lang.Object object)
Encoder
to()
Encoder
to(java.io.File file)
Encoder
to(java.io.OutputStream out)
Encoder
to(java.lang.Appendable out)
java.lang.String
toString()
Encoder
writeDefaults()
-
-
-
Method Detail
-
put
public Encoder put(java.lang.Object object) throws java.lang.Exception
- Throws:
java.lang.Exception
-
mark
public Encoder mark() throws java.security.NoSuchAlgorithmException
- Throws:
java.security.NoSuchAlgorithmException
-
digest
public byte[] digest() throws java.security.NoSuchAlgorithmException, java.io.IOException
- Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
-
to
public Encoder to() throws java.io.IOException
- Throws:
java.io.IOException
-
to
public Encoder to(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
charset
public Encoder charset(java.lang.String encoding)
-
charset
public Encoder charset(java.nio.charset.Charset encoding)
-
to
public Encoder to(java.io.OutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
to
public Encoder to(java.lang.Appendable out) throws java.io.IOException
- Throws:
java.io.IOException
-
append
public java.lang.Appendable append(char c) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Throws:
java.io.IOException
-
append
public java.lang.Appendable append(java.lang.CharSequence sq) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Throws:
java.io.IOException
-
append
public java.lang.Appendable append(java.lang.CharSequence sq, int start, int length) throws java.io.IOException
- Specified by:
append
in interfacejava.lang.Appendable
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
writeDefaults
public Encoder writeDefaults()
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Throws:
java.io.IOException
-
deflate
public Encoder deflate()
-
indent
public Encoder indent(java.lang.String tabs)
-
keepOpen
public Encoder keepOpen()
-
-