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

8
LINES

< > BotCompany Repo | #1029048 // getAndClearStringBuffer - atomic. also releases memory

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (41L/1K).

sS getAndClearStringBuffer(StringBuffer buf) {
  if (buf == null) null;
  synchronized(buf) {
    S s = buf.toString();
    clearStringBuffer(buf);
    ret s;
  }
}

Author comment

Began life as a copy of #1016735

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: #1029048
Snippet name: getAndClearStringBuffer - atomic. also releases memory
Eternal ID of this version: #1029048/1
Text MD5: dac68861da5a8ada5c5ab376a71104fd
Transpilation MD5: 8326be0cf4cff6282e1ebbc75db0266b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-17 18:04:49
Source code size: 171 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 184 / 283
Referenced in: [show references]