Skip to content

Commit b6a8d3a

Browse files
committed
gJF
1 parent c1f6d75 commit b6a8d3a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

firebase-common/src/main/java/com/google/firebase/heartbeatinfo/DefaultHeartBeatController.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,14 @@ public Task<String> getHeartBeatsHeader() {
102102
JSONObject output = new JSONObject();
103103
output.put("heartbeats", array);
104104
output.put("version", "2");
105-
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
106-
try (Base64OutputStream b64os =
107-
new Base64OutputStream(
108-
out, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP)) {
109-
try (GZIPOutputStream gzip = new GZIPOutputStream(b64os)) {
110-
gzip.write(output.toString().getBytes("UTF-8"));
111-
}
112-
}
113-
return out.toString("UTF-8");
105+
ByteArrayOutputStream out = new ByteArrayOutputStream();
106+
try (Base64OutputStream b64os =
107+
new Base64OutputStream(
108+
out, Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP);
109+
GZIPOutputStream gzip = new GZIPOutputStream(b64os); ) {
110+
gzip.write(output.toString().getBytes("UTF-8"));
114111
}
112+
return out.toString("UTF-8");
115113
}
116114
});
117115
}

0 commit comments

Comments
 (0)