deflorator1980

Untitled

Jan 18th, 2017
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1.     public synchronized void writeString(String string) {
  2.         Path logPath = Paths.get(ServiceOptions.getInstance().getCacheStorePath(), LOG_FILE_NAME);
  3.         byte data[] = (string+"\n").getBytes();
  4.         try (OutputStream out = new BufferedOutputStream(
  5.                 Files.newOutputStream(logPath, StandardOpenOption.CREATE, StandardOpenOption.APPEND))) {
  6.             out.write(data, 0, data.length);
  7.         } catch (IOException ioe) {
  8.             LOGGER.error("", ioe);
  9.         }
  10.     }
Add Comment
Please, Sign In to add comment