public final class TextBuffer extends Object
Constructor and Description |
---|
TextBuffer(com.fasterxml.jackson.core.util.BufferRecycler allocator) |
Modifier and Type | Method and Description |
---|---|
char[] |
contentsAsArray() |
BigDecimal |
contentsAsDecimal()
Convenience method for converting contents of the buffer
into a
BigDecimal . |
double |
contentsAsDouble()
Convenience method for converting contents of the buffer
into a Double value.
|
String |
contentsAsString() |
char[] |
emptyAndGetCurrentSegment() |
void |
ensureNotShared()
Method called to make sure that buffer is not using shared input
buffer; if it is, it will copy such contents to private buffer.
|
String |
finishAndReturn(int lastSegmentEnd,
boolean trimTrailingSpaces) |
char[] |
finishCurrentSegment() |
char[] |
getCurrentSegment() |
int |
getCurrentSegmentSize() |
char[] |
getTextBuffer() |
int |
getTextOffset() |
boolean |
hasTextAsCharacters() |
boolean |
looksLikeInt() |
void |
releaseBuffers() |
void |
reset() |
void |
resetWithShared(char[] buf,
int start,
int len) |
void |
resetWithString(String value) |
int |
size() |
String |
toString()
Note: calling this method may not be as efficient as calling
contentsAsString() , since it's not guaranteed that resulting
String is cached. |
public TextBuffer(com.fasterxml.jackson.core.util.BufferRecycler allocator)
public void releaseBuffers()
public void reset()
public void resetWithShared(char[] buf, int start, int len)
public void resetWithString(String value)
public int size()
public int getTextOffset()
public boolean hasTextAsCharacters()
public char[] getTextBuffer()
public String contentsAsString()
public char[] contentsAsArray()
public BigDecimal contentsAsDecimal() throws NumberFormatException
BigDecimal
.NumberFormatException
public double contentsAsDouble() throws NumberFormatException
NumberFormatException
public boolean looksLikeInt()
public void ensureNotShared()
public char[] getCurrentSegment()
public final char[] emptyAndGetCurrentSegment()
public int getCurrentSegmentSize()
public String finishAndReturn(int lastSegmentEnd, boolean trimTrailingSpaces)
lastSegmentEnd
- End offset in the currently active segment,
could be 0 in the case of first character is
delimiter or end-of-linetrimTrailingSpaces
- Whether trailing spaces should be trimmed or notpublic char[] finishCurrentSegment()
public String toString()
contentsAsString()
, since it's not guaranteed that resulting
String is cached.Copyright © 2016 FasterXML. All rights reserved.