File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/metadata Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -428,15 +428,14 @@ private void expandIfNecessary(int dataLength) throws IOException {
428
428
429
429
// If the buffer is split, we need to make it contiguous
430
430
if (endOfLastElement < first .position ) {
431
- FileChannel channel ;
432
- try (RandomAccessFile raf = open (rafFile )) {
433
- channel = raf .getChannel ();
434
- }
435
- channel .position (fileLength ); // destination position
436
- int count = endOfLastElement - Element .HEADER_LENGTH ;
437
- if (channel .transferTo (HEADER_LENGTH , count , channel ) != count ) {
438
- throw new AssertionError ("Copied insufficient number of bytes!" );
439
- }
431
+ openAndExecute (raf -> {
432
+ FileChannel channel = raf .getChannel ();
433
+ channel .position (fileLength ); // destination position
434
+ int count = endOfLastElement - Element .HEADER_LENGTH ;
435
+ if (channel .transferTo (HEADER_LENGTH , count , channel ) != count ) {
436
+ throw new AssertionError ("Copied insufficient number of bytes!" );
437
+ }
438
+ });
440
439
}
441
440
442
441
// Commit the expansion.
You can’t perform that action at this time.
0 commit comments