Redundant/duplicate method to close Streams
Fixes: 62304559 Test: the code compiles which mean polymorphism works. No additional tests necessary Change-Id: I3d366f12c1f176213979da6b050957bc2adb2938
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package android.drm;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -79,26 +80,16 @@ public class DrmUtils {
|
||||
file.delete();
|
||||
}
|
||||
|
||||
private static void quietlyDispose(InputStream stream) {
|
||||
private static void quietlyDispose(Closeable closable) {
|
||||
try {
|
||||
if (null != stream) {
|
||||
stream.close();
|
||||
if (null != closable) {
|
||||
closable.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// no need to care, at least as of now
|
||||
}
|
||||
}
|
||||
|
||||
private static void quietlyDispose(OutputStream stream) {
|
||||
try {
|
||||
if (null != stream) {
|
||||
stream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// no need to care
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an instance of {@link DrmUtils.ExtendedMetadataParser}, which can be used to parse
|
||||
* extended metadata embedded in DRM constraint information.
|
||||
|
||||
Reference in New Issue
Block a user