public class DefaultSitemeshBuffer extends java.lang.Object implements SitemeshBuffer
Modifier and Type | Class and Description |
---|---|
static class |
DefaultSitemeshBuffer.Builder |
Modifier and Type | Field and Description |
---|---|
private char[] |
buffer |
private java.util.TreeMap<java.lang.Integer,SitemeshBufferFragment> |
bufferFragments |
private int |
length |
Constructor and Description |
---|
DefaultSitemeshBuffer(char[] buffer) |
DefaultSitemeshBuffer(char[] buffer,
int length) |
DefaultSitemeshBuffer(char[] buffer,
int length,
java.util.TreeMap<java.lang.Integer,SitemeshBufferFragment> bufferFragments) |
Modifier and Type | Method and Description |
---|---|
static DefaultSitemeshBuffer.Builder |
builder() |
static DefaultSitemeshBuffer.Builder |
builder(SitemeshBuffer sitemeshBuffer) |
int |
getBufferLength()
Get the length of the buffered content.
|
char[] |
getCharArray()
Get the char array for this buffer.
|
int |
getTotalLength()
Get the total length of the buffered content, including the length of any chained buffers.
|
int |
getTotalLength(int start,
int length)
Get the total length of the buffered content, including chained buffers from start to length
|
boolean |
hasFragments()
Whether the buffer has fragments or not
|
void |
writeTo(java.io.Writer writer,
int start,
int length)
Write this buffer, and any chained sub buffers in the given range, out to the given writer
|
private final char[] buffer
private final int length
private final java.util.TreeMap<java.lang.Integer,SitemeshBufferFragment> bufferFragments
public DefaultSitemeshBuffer(char[] buffer)
public DefaultSitemeshBuffer(char[] buffer, int length)
public DefaultSitemeshBuffer(char[] buffer, int length, java.util.TreeMap<java.lang.Integer,SitemeshBufferFragment> bufferFragments)
public void writeTo(java.io.Writer writer, int start, int length) throws java.io.IOException
SitemeshBuffer
writeTo
in interface SitemeshBuffer
writer
- The writer to write tostart
- The position to start writing fromlength
- The length to writejava.io.IOException
- If an error occurredpublic int getTotalLength()
SitemeshBuffer
getTotalLength
in interface SitemeshBuffer
public int getTotalLength(int start, int length)
SitemeshBuffer
getTotalLength
in interface SitemeshBuffer
start
- Where to start counting the length fromlength
- Where to finishpublic int getBufferLength()
SitemeshBuffer
getBufferLength
in interface SitemeshBuffer
public char[] getCharArray()
SitemeshBuffer
getCharArray
in interface SitemeshBuffer
public boolean hasFragments()
SitemeshBuffer
hasFragments
in interface SitemeshBuffer
public static DefaultSitemeshBuffer.Builder builder()
public static DefaultSitemeshBuffer.Builder builder(SitemeshBuffer sitemeshBuffer)