Class LazyString

java.lang.Object
io.helidon.common.buffers.LazyString

public class LazyString extends Object
String that materializes only when requested.
  • Constructor Details

    • LazyString

      public LazyString(byte[] buffer, int offset, int length, Charset charset)
      New instance.
      Parameters:
      buffer - buffer to use
      offset - offset within the buffer
      length - length
      charset - character set to construct the string
    • LazyString

      public LazyString(byte[] buffer, Charset charset)
      New instance.
      Parameters:
      buffer - buffer to use (all bytes)
      charset - character set to construct the string
  • Method Details

    • stripOws

      public String stripOws()
      Strip optional whitespace(s) from beginning and end of the String. Defined by the HTTP specification, OWS is a sequence of zero to n space and/or horizontal tab characters.
      Returns:
      string without optional leading and trailing whitespaces
    • toString

      public String toString()
      Overrides:
      toString in class Object