Skip to content

Commit 1703500

Browse files
committed
see 09/14 log
1 parent cc5eff2 commit 1703500

File tree

5 files changed

+13
-21
lines changed

5 files changed

+13
-21
lines changed

utilcode/src/main/java/com/blankj/utilcode/utils/ConvertUtils.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,14 +275,9 @@ public static OutputStream string2OutputStream(String string, String charsetName
275275
*/
276276
public static byte[] bitmap2Bytes(Bitmap bitmap, Bitmap.CompressFormat format) {
277277
if (bitmap == null) return null;
278-
ByteArrayOutputStream baos = null;
279-
try {
280-
baos = new ByteArrayOutputStream();
281-
bitmap.compress(format, 100, baos);
282-
return baos.toByteArray();
283-
} finally {
284-
FileUtils.closeIO(baos);
285-
}
278+
ByteArrayOutputStream baos = new ByteArrayOutputStream();
279+
bitmap.compress(format, 100, baos);
280+
return baos.toByteArray();
286281
}
287282

288283
/**

utilcode/src/main/java/com/blankj/utilcode/utils/ImageUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,4 +1368,4 @@ public static Bitmap compressBySampleSize(Bitmap src, int sampleSize, boolean re
13681368
if (recycle && !src.isRecycled()) src.recycle();
13691369
return BitmapFactory.decodeByteArray(bytes, 0, bytes.length, options);
13701370
}
1371-
}
1371+
}

utilcode/src/main/java/com/blankj/utilcode/utils/SPUtils.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public boolean getBoolean(String key, boolean defaultValue) {
186186
}
187187

188188
/**
189-
* 获取SP中所有键值对
189+
* SP中获取所有键值对
190190
*
191191
* @return Map对象
192192
*/
@@ -195,7 +195,7 @@ public boolean getBoolean(String key, boolean defaultValue) {
195195
}
196196

197197
/**
198-
* 从SP中移除该key
198+
* SP中移除该key
199199
*
200200
* @param key 键
201201
*/
@@ -204,7 +204,7 @@ public void remove(String key) {
204204
}
205205

206206
/**
207-
* 判断SP中是否存在该key
207+
* SP中是否存在该key
208208
*
209209
* @param key 键
210210
* @return {@code true}: 存在<br>{@code false}: 不存在
@@ -214,11 +214,9 @@ public boolean contains(String key) {
214214
}
215215

216216
/**
217-
* 清除SP中所有数据
217+
* SP中清除所有数据
218218
*/
219219
public void clear() {
220220
editor.clear().apply();
221221
}
222-
223-
224-
}
222+
}

utilcode/src/main/java/com/blankj/utilcode/utils/ZipUtils.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.blankj.utilcode.utils;
22

3-
43
import java.io.BufferedInputStream;
54
import java.io.BufferedOutputStream;
65
import java.io.File;
@@ -334,9 +333,9 @@ public static List<File> unzipFileByKeyword(File zipFile, File destDir, String k
334333
* @return 压缩文件中的文件路径链表
335334
* @throws IOException IO错误时抛出
336335
*/
337-
public static List<String> getFilePathInZip(String zipFilePath)
336+
public static List<String> getFilesPath(String zipFilePath)
338337
throws IOException {
339-
return getFilePathInZip(FileUtils.getFileByPath(zipFilePath));
338+
return getFilesPath(FileUtils.getFileByPath(zipFilePath));
340339
}
341340

342341
/**
@@ -346,7 +345,7 @@ public static List<String> getFilePathInZip(String zipFilePath)
346345
* @return 压缩文件中的文件路径链表
347346
* @throws IOException IO错误时抛出
348347
*/
349-
public static List<String> getFilePathInZip(File zipFile)
348+
public static List<String> getFilesPath(File zipFile)
350349
throws IOException {
351350
if (zipFile == null) return null;
352351
List<String> paths = new ArrayList<>();

utilcode/src/test/java/com/blankj/utilcode/utils/ZipUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void testUnzipFileByKeyword() throws Exception {
5858

5959
@Test
6060
public void testGetFileNamesInZip() throws Exception {
61-
System.out.println(ZipUtils.getFilePathInZip(testZipFile));
61+
System.out.println(ZipUtils.getFilesPath(testZipFile));
6262
}
6363

6464
@Test

0 commit comments

Comments
 (0)