forked from I2P_Developers/i2p.i2p
Util: Consolidate two copies of WriterOutputStream into jetty-i2p.jar
This commit is contained in:
@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import net.i2p.I2PAppContext;
|
import net.i2p.I2PAppContext;
|
||||||
import net.i2p.data.ByteArray;
|
import net.i2p.data.ByteArray;
|
||||||
import net.i2p.data.DataHelper;
|
import net.i2p.data.DataHelper;
|
||||||
|
import net.i2p.servlet.util.WriterOutputStream;
|
||||||
import net.i2p.util.ByteCache;
|
import net.i2p.util.ByteCache;
|
||||||
import net.i2p.util.Log;
|
import net.i2p.util.Log;
|
||||||
import net.i2p.util.SystemVersion;
|
import net.i2p.util.SystemVersion;
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
package org.klomp.snark.web;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.Writer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Treat a writer as an output stream. Quick 'n dirty, none
|
|
||||||
* of that "intarnasheeonaleyzayshun" stuff. So we can treat
|
|
||||||
* the jsp's PrintWriter as an OutputStream
|
|
||||||
*
|
|
||||||
* @since Jetty 7 copied from routerconsole
|
|
||||||
*/
|
|
||||||
class WriterOutputStream extends OutputStream {
|
|
||||||
private final Writer _writer;
|
|
||||||
|
|
||||||
public WriterOutputStream(Writer writer) { _writer = writer; }
|
|
||||||
public void write(int b) throws IOException { _writer.write(b); }
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
package net.i2p.router.web.helpers;
|
package net.i2p.servlet.util;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@ -8,10 +8,13 @@ import java.io.Writer;
|
|||||||
* Treat a writer as an output stream. Quick 'n dirty, none
|
* Treat a writer as an output stream. Quick 'n dirty, none
|
||||||
* of that "intarnasheeonaleyzayshun" stuff. So we can treat
|
* of that "intarnasheeonaleyzayshun" stuff. So we can treat
|
||||||
* the jsp's PrintWriter as an OutputStream
|
* the jsp's PrintWriter as an OutputStream
|
||||||
|
*
|
||||||
|
* @since 0.9.33 consolidated from routerconsole and i2psnark
|
||||||
*/
|
*/
|
||||||
public class WriterOutputStream extends OutputStream {
|
public class WriterOutputStream extends OutputStream {
|
||||||
private Writer _writer;
|
private final Writer _writer;
|
||||||
|
|
||||||
public WriterOutputStream(Writer writer) { _writer = writer; }
|
public WriterOutputStream(Writer writer) { _writer = writer; }
|
||||||
|
|
||||||
public void write(int b) throws IOException { _writer.write(b); }
|
public void write(int b) throws IOException { _writer.write(b); }
|
||||||
}
|
}
|
@ -6,6 +6,7 @@ import java.util.Set;
|
|||||||
import net.i2p.data.DataFormatException;
|
import net.i2p.data.DataFormatException;
|
||||||
import net.i2p.data.Hash;
|
import net.i2p.data.Hash;
|
||||||
import net.i2p.router.web.HelperBase;
|
import net.i2p.router.web.HelperBase;
|
||||||
|
import net.i2p.servlet.util.WriterOutputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dump the peer profile data if given a full B64 peer string or prefix.
|
* Dump the peer profile data if given a full B64 peer string or prefix.
|
||||||
|
Reference in New Issue
Block a user