public final class MemoryClearingBuffer extends Object
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the buffer out, filling its cells with null.
|
byte[] |
getBytes()
Returns the
byte[] used to create this buffer, or
getComputedBytes() if created with a char[] . |
char[] |
getChars()
Returns the
char[] used to create this buffer, or
getComputedChars() if created with a byte[] . |
static MemoryClearingBuffer |
newInstance(byte[] bytes)
Creates a new instance of MemoryClearingBuffer from a
byte[] . |
static MemoryClearingBuffer |
newInstance(char[] chars)
Creates a new instance of MemoryClearingBuffer from a
char[] . |
static MemoryClearingBuffer |
newInstance(char[] chars,
boolean trim,
boolean lowerCase)
Creates a new instance of MemoryClearingBuffer from a
char[] , optionally performing whitespace trimming and
conversion to lower case. |
public static MemoryClearingBuffer newInstance(byte[] bytes)
byte[]
.bytes
- A byte[]public static MemoryClearingBuffer newInstance(char[] chars)
char[]
.chars
- A char[]public static MemoryClearingBuffer newInstance(char[] chars, boolean trim, boolean lowerCase)
char[]
, optionally performing whitespace trimming and
conversion to lower case.chars
- A char[]trim
- If true, whitespace will be trimmed off of both ends of the
char[]
lowerCase
- If true, the characters will be converted to lower casepublic void clear()
public byte[] getBytes()
byte[]
used to create this buffer, or
getComputedBytes() if created with a char[]
.public char[] getChars()
char[]
used to create this buffer, or
getComputedChars() if created with a byte[]
.Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.