1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-15 20:47:11 +00:00

Use Java 16 ByteBuffer methods where possible

This commit is contained in:
Jonathan Coates
2021-12-18 11:34:44 +00:00
parent 05da4dd362
commit 2f6ad00764
2 changed files with 3 additions and 6 deletions

View File

@@ -53,10 +53,6 @@ public class FileSlice
return;
}
ByteBuffer other = file.duplicate();
other.position( offset ); // TODO: In 1.17 we can use a separate put(idx, _) method.
other.put( bytes );
if( bytes.remaining() != 0 ) throw new IllegalStateException( "Should have read the whole buffer" );
file.put( offset, bytes, bytes.position(), bytes.remaining() );
}
}