Transpiled version (2495L) is out of date.
1 | static long raf_findBeginningOfLine(RandomAccessFile raf, long pos, int bufSize) ctex { |
2 | byte[] buf = new byte[bufSize]; |
3 | while (pos > 0) { |
4 | long start = Math.max(pos-bufSize, 0); |
5 | raf.seek(start); |
6 | raf.readFully(buf, 0, (int) Math.min(pos-start, bufSize)); |
7 | int idx = lastIndexOf_byteArray(buf, (byte) '\n'); |
8 | if (idx >= 0) ret start+idx+1; |
9 | pos = start; |
10 | } |
11 | ret 0; |
12 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1028342 |
Snippet name: | raf_findBeginningOfLine [dev.] |
Eternal ID of this version: | #1028342/12 |
Text MD5: | b2a33fbe882674f0f75878cdca5c40b7 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-06-13 11:37:26 |
Source code size: | 401 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 228 / 350 |
Version history: | 11 change(s) |
Referenced in: | [show references] |