public class Zipper extends JSONzip
bcd, end, endOfNumber, int14, int4, int7, namehuff, namehuffext, namekeep, probe, stringhuff, stringhuffext, stringkeep, valuekeep, zipArrayString, zipArrayValue, zipEmptyArray, zipEmptyObject, zipFalse, zipNull, zipObject, zipTrue
Constructor and Description |
---|
Zipper(BitWriter bitwriter)
Create a new encoder.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(JSONArray jsonarray)
Encode a JSONArray.
|
void |
encode(JSONObject jsonobject)
Encode a JSONObject.
|
void |
flush()
Finish the final byte and flush the bitwriter.
|
void |
pad(int width)
Pad the output to fill an allotment of bits.
|
generate, postMortem
public Zipper(BitWriter bitwriter)
bitwriter
- The BitWriter this encoder will output to.
Don't forget to flush.public void flush() throws JSONException
JSONException
public void pad(int width) throws JSONException
width
- The size of the bit allotment. A value of 8 will complete and
flush the current byte. If you don't pad, then some of the
last bits might not be sent to the Output Stream.JSONException
public void encode(JSONObject jsonobject) throws JSONException
jsonobject
- The JSONObject.JSONException
public void encode(JSONArray jsonarray) throws JSONException
jsonarray
- The JSONArray.JSONException