/** * Returns the bytes that have been written on the current writers output stream.<p> * * @return the bytes that have been written on the current writers output stream */ public byte[] getWriterBytes() { if (isSuspended()) { // No output whatsoever if the response is suspended return new byte[0]; } if (m_cacheBytes != null) { // Optimization for cached "leaf" nodes, here I re-use the array from the cache return m_cacheBytes; } if (m_out == null) { // No output was written so far, just return an empty array return new byte[0]; } if (m_writer != null) { // Flush the writer in case something was written on it m_writer.flush(); } return m_out.getBytes(); }
/** * Returns the bytes that have been written on the current writers output stream.<p> * * @return the bytes that have been written on the current writers output stream */ public byte[] getWriterBytes() { if (isSuspended()) { // No output whatsoever if the response is suspended return new byte[0]; } if (m_cacheBytes != null) { // Optimization for cached "leaf" nodes, here I re-use the array from the cache return m_cacheBytes; } if (m_out == null) { // No output was written so far, just return an empty array return new byte[0]; } if (m_writer != null) { // Flush the writer in case something was written on it m_writer.flush(); } return m_out.getBytes(); }