void writeComment(Object comment) throws IOException { // TODO Auto-generated method stub flushElement(); state = inDocumentState; state.writeComment(comment); }
void writeText(char[] text, int off, int len) throws IOException { // TODO Auto-generated method stub flushElement(); state = cdataState; state.writeText(text, off, len); }
void writeComment(Object comment) throws IOException { flushCDATA(); state = inDocumentState; state.writeComment(comment); }
public InputStream getWrittenDataAsStream() throws IOException { flushBuffers(); if (stream != null) { ByteBuffer firstBuffer = stream.getFirstBuffer(); firstBuffer.compact(); return new FastBufferInputStream(firstBuffer); } else { return EMPTY_STREAM; } }
@Override public long getSize() { return buffer.getLast().getTotalSize(); }
/** * Creates instance with required initial capacity. * * @param initialSize */ public FastBufferOutputStream(int initialSize) { this(new ByteBuffer(initialSize)); }
/** * @see java.io.OutputStream#write(int) */ public void write(int c) throws IOException { lastBuffer = lastBuffer.append((byte) c); length++; }
/** * Returns total number of bytes stored in this link and all its predecessors. * * @return total number of bytes stored in this link and all its predecessors */ public int getTotalSize() { return (prev == null) ? usedSize : prev.getTotalSize() + usedSize; }
public void complete() { buffer.compact(); } }
void endDocument() throws IOException { flushCDATA(); state = inDocumentState; state.endDocument(); }
void endElement(String name) throws IOException { flushCDATA(); state = inDocumentState; state.endElement(name); }
void endElement(String name) throws IOException { // flushElement(); state = inDocumentState; state.endElement(name); }
/** * @see java.io.Writer#write(int) */ public void write(int c) throws IOException { lastBuffer = lastBuffer.append((char) c); length++; }
/** * Resets stream to empty state * * @since 3.3.0 */ public void reset() { this.firstBuffer.reset(); this.lastBuffer = this.firstBuffer; this.length = 0; } }
/** * Creates instance with required initial capacity. * * @param initialSize */ public FastBufferWriter(int initialSize) { this(new CharBuffer(initialSize)); }
@Override public FastBufferOutputStream getResponseOutputStream() { if (stream == null) { stream = new FastBufferOutputStream(); } return stream; }
/** * Returns total number of characters stored in this link and all its predecessors. * * @return total number of characters stored in this link and all its predecessors */ public int getTotalSize() { return (prev == null) ? usedSize : prev.getTotalSize() + usedSize; }
/** * Resets writer to empty state * * @since 3.3.0 */ public void reset() { this.firstBuffer.reset(); this.lastBuffer = this.firstBuffer; this.length = 0; } }
void write(char[] cbuf, int off, int len) throws IOException { writeText(cbuf, off, len); } }
void writeText(Object text, String property) throws IOException { // TODO Auto-generated method stub flushElement(); state = cdataState; state.writeText(text, property); } }