Fork me on GitHub

PooledSpecializedStringWriter

In package com.mitchellbosecke.pebble.extension.writer

public class PooledSpecializedStringWriter extends Writer implements SpecializedWriter

A ${@link SpecializedWriter} that's pooled in a ${@link ThreadLocal}. It's backed by a ${@link StringBuilder} so it's not threadsafe but doesn't involve synchronization. Beware that it has some limitations:

  • As it's backed by a ${@link ThreadLocal}, it might leak in environments where ClassLoaders are rebooted at runtime
  • It doesn't take any security measure against very large payloads that would cause underlying buffers to eat memory

Methods

public void writeSpecialized(int i)
Parameters:
  • int i
public void writeSpecialized(long l)
Parameters:
  • long l
public void writeSpecialized(double d)
Parameters:
  • double d
public void writeSpecialized(float f)
Parameters:
  • float f
public void writeSpecialized(short s)
Parameters:
  • short s
public void writeSpecialized(byte b)
Parameters:
  • byte b
public void writeSpecialized(char c)
Parameters:
  • char c
public void writeSpecialized(String s)
Parameters:
  • String s
public void write(char cbuf, int off, int len)
Parameters:
  • char cbuf
  • int off
  • int len
public void flush()
Parameters:
  • No parameters
public void close()
Parameters:
  • No parameters
public String toString()
Parameters:
  • No parameters
public static PooledSpecializedStringWriter pooled()
Parameters:
  • No parameters