Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

17
LINES

< > BotCompany Repo | #1000947 // class LineBuf

JavaX fragment (include)

1  
static class LineBuf {
2  
  new StringBuffer buf;
3  
  
4  
  void append(String s) {
5  
    buf.append(s);
6  
  }
7  
  
8  
  String nextLine() {
9  
    int i = buf.indexOf("\n");
10  
    if (i >= 0) {
11  
      String s = buf.substring(0, i > 0 && buf.charAt(i-1) == '\r' ? i-1 : i);
12  
      buf.delete(0, i+1);
13  
      return s;
14  
    }
15  
    return null;
16  
  }
17  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1000947
Snippet name: class LineBuf
Eternal ID of this version: #1000947/1
Text MD5: 7497ff36558ef564bd9fb677a68f102c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-09-11 17:15:39
Source code size: 338 bytes / 17 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 635 / 1038
Referenced in: [show references]