Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb7a1aee

Browse files
log
1 parent7ff3fa4 commitb7a1aee

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

‎zip/Compressor.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ of this software and associated documentation files (the "Software"), to deal
3838
* JSONzip is a compression scheme for JSON text.
3939
*
4040
* @author JSON.org
41-
* @version2013-04-18
41+
* @version2014-04-21
4242
*/
4343

4444
/**
@@ -110,9 +110,6 @@ public void flush() throws JSONException {
110110
* @throws IOException
111111
*/
112112
privatevoidone()throwsJSONException {
113-
if (probe) {
114-
log(1);
115-
}
116113
write(1,1);
117114
}
118115

@@ -351,7 +348,7 @@ private void writeObject(JSONObject jsonobject) throws JSONException {
351348
Iteratorkeys =jsonobject.keys();
352349
while (keys.hasNext()) {
353350
if (probe) {
354-
log("\n");
351+
log();
355352
}
356353
Objectkey =keys.next();
357354
if (keyinstanceofString) {
@@ -545,9 +542,6 @@ private void writeValue(Object value) throws JSONException {
545542
* @throws IOException
546543
*/
547544
privatevoidzero()throwsJSONException {
548-
if (probe) {
549-
log(0);
550-
}
551545
write(0,1);
552546
}
553547

‎zip/Decompressor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ of this software and associated documentation files (the "Software"), to deal
3535
* JSONzip is a compression scheme for JSON text.
3636
*
3737
* @author JSON.org
38-
* @version2013-04-18
38+
* @version2014-04-21
3939
*/
4040

4141
publicclassDecompressorextendsJSONzip {
@@ -221,7 +221,7 @@ private JSONObject readObject() throws JSONException {
221221
JSONObjectjsonobject =newJSONObject();
222222
while (true) {
223223
if (probe) {
224-
log("\n");
224+
log();
225225
}
226226
Stringname =readName();
227227
jsonobject.put(name, !bit() ?readString() :readValue());

‎zip/JSONzip.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
packageorg.json.zip;
22

3-
43
/*
54
Copyright (c) 2013 JSON.org
65
@@ -27,7 +26,9 @@ of this software and associated documentation files (the "Software"), to deal
2726

2827
/**
2928
* JSONzip is a binary-encoded JSON dialect. It is designed to compress the
30-
* messages in a session. It is adaptive, so with each message seen, it should
29+
* messages in a session in bandwidth constrained applications, such as mobile.
30+
*
31+
* JSONzip is adaptive, so with each message seen, it should
3132
* improve its compression. It minimizes JSON's overhead, reducing punctuation
3233
* to a small number of bits. It uses Huffman encoding to reduce the average
3334
* size of characters. It uses caches (or Keeps) to keep recently seen strings
@@ -43,7 +44,7 @@ of this software and associated documentation files (the "Software"), to deal
4344
* ADEQUATELY FOR PRODUCTION USE.
4445
*
4546
* @author JSON.org
46-
* @version2013-04-18
47+
* @version2014-04-21
4748
*/
4849
publicabstractclassJSONzipimplementsNone,PostMortem {
4950
/**
@@ -230,12 +231,17 @@ static void log(int integer) {
230231

231232
/**
232233
* Write two integers, separated by ':' to the console.
234+
* The second integer is suppressed if it is 1.
233235
*
234236
* @param integer
235237
* @param width
236238
*/
237239
staticvoidlog(intinteger,intwidth) {
238-
log(integer +":" +width +" ");
240+
if (width ==1) {
241+
log(integer);
242+
}else {
243+
log(integer +":" +width +" ");
244+
}
239245
}
240246

241247
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp