/******************************************************************************* * Copyright (c) 2012-2016 Codenvy, S.A. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Codenvy, S.A. - initial API and implementation *******************************************************************************/ package org.everrest.core.servlet; import javax.servlet.ServletOutputStream; import javax.servlet.WriteListener; import java.io.ByteArrayOutputStream; import java.io.IOException; class TstServletOutputStream extends ServletOutputStream { private ByteArrayOutputStream data = new ByteArrayOutputStream(); byte[] getData() { return data.toByteArray(); } @Override public boolean isReady() { return true; } @Override public void setWriteListener(WriteListener writeListener) { } @Override public void write(int b) throws IOException { data.write(b); } }