/** * This can <b>ONLY</b> be called if there is only a single buffer to write, instead * use {@link #writeTo(java.io.Writer, String)}, which auto detects if * {@link #writeToViaString(java.io.Writer, String)} is to be used or * {@link #writeToViaSmoosh(java.io.Writer, String)}. * * @param out the JspWriter * @param encoding the encoding * @throws IOException */ void writeToViaString(Writer out, String encoding) throws IOException { byte[] bufferToWrite = buffer; // this is always the last buffer to write int bufferToWriteLen = index; // index points to our place in the last buffer writeToImpl(out, encoding, bufferToWrite, bufferToWriteLen); }
/** * This can <b>ONLY</b> be called if there is only a single buffer to write, instead * use {@link #writeTo(java.io.Writer, String)}, which auto detects if * {@link #writeToViaString(java.io.Writer, String)} is to be used or * {@link #writeToViaSmoosh(java.io.Writer, String)}. * * @param out the JspWriter * @param encoding the encoding * @throws IOException */ void writeToViaString(Writer out, String encoding) throws IOException { byte[] bufferToWrite = buffer; // this is always the last buffer to write int bufferToWriteLen = index; // index points to our place in the last buffer writeToImpl(out, encoding, bufferToWrite, bufferToWriteLen); }
/** * This is recommended to be used where there's more than 1 buffer to write, instead * use {@link #writeTo(java.io.Writer, String)} which auto detects if * {@link #writeToViaString(java.io.Writer, String)} is to be used or * {@link #writeToViaSmoosh(java.io.Writer, String)}. * * @param out * @param encoding * @throws IOException */ void writeToViaSmoosh(Writer out, String encoding) throws IOException { byte[] bufferToWrite = toByteArray(); int bufferToWriteLen = bufferToWrite.length; writeToImpl(out, encoding, bufferToWrite, bufferToWriteLen); }
/** * This is recommended to be used where there's more than 1 buffer to write, instead * use {@link #writeTo(java.io.Writer, String)} which auto detects if * {@link #writeToViaString(java.io.Writer, String)} is to be used or * {@link #writeToViaSmoosh(java.io.Writer, String)}. * * @param out * @param encoding * @throws IOException */ void writeToViaSmoosh(Writer out, String encoding) throws IOException { byte[] bufferToWrite = toByteArray(); int bufferToWriteLen = bufferToWrite.length; writeToImpl(out, encoding, bufferToWrite, bufferToWriteLen); }