Libraryless. Click here for Pure Java version (2192L/14K).
1 | sbool filesHaveSameContents(File a, File b) ctex { |
2 | long n = fileSize(a); |
3 | if (fileSize(b) != n) false; |
4 | |
5 | temp InputStream is1 = newBufferedInputStream(a); |
6 | temp InputStream is2 = newBufferedInputStream(b); |
7 | |
8 | int data; |
9 | while ping ((data = is1.read()) != -1) |
10 | if (data != is2.read()) false; |
11 | |
12 | true; |
13 | } |
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1025332 |
Snippet name: | filesHaveSameContents |
Eternal ID of this version: | #1025332/2 |
Text MD5: | 2a4c17b9c1f7c67bda40cc58149a5854 |
Transpilation MD5: | 3fffc7ffa41b70e5d6d686132013ba1f |
Author: | stefan |
Category: | javax / io |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-09-23 13:34:07 |
Source code size: | 326 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 175 / 257 |
Version history: | 1 change(s) |
Referenced in: | [show references] |