File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
jpegkit/src/main/java/com/jpegkit Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ private Jpeg() {
1717 }
1818
1919 public Jpeg (@ NonNull byte [] jpegBytes ) {
20+ mount (jpegBytes );
21+ }
22+
23+ protected void mount (byte [] jpegBytes ) {
2024 synchronized (sJniLock ) {
2125 mHandle = jniMount (jpegBytes );
2226 }
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public class JpegFile extends Jpeg {
1313
1414 private File mJpegFile ;
1515
16- public JpegFile (@ NonNull File jpegFile ) throws IOException {
16+ public JpegFile (@ NonNull final File jpegFile ) throws IOException {
1717 super (dumpFile (jpegFile ));
1818 mJpegFile = jpegFile ;
1919 }
@@ -28,6 +28,12 @@ public void save() throws IOException {
2828 outputStream .close ();
2929 }
3030
31+ public void reload () throws Exception {
32+ byte [] jpegBytes = dumpFile (mJpegFile );
33+ release ();
34+ mount (jpegBytes );
35+ }
36+
3137 private static byte [] dumpFile (File file ) throws IOException {
3238 FileInputStream inputStream = new FileInputStream (file );
3339 byte [] fileBytes = new byte [inputStream .available ()];
You can’t perform that action at this time.
0 commit comments