/** * Writes the cache out onto the underlying stream * @throws IOException */ protected void flushCache() throws IOException { if (this.cachePosition > 0) { this.out.writeLine(Integer.toHexString(this.cachePosition)); this.out.write(this.cache, 0, this.cachePosition); this.out.writeLine(""); this.cachePosition = 0; } }
protected void writeHeadLine(final HttpMessage message) throws IOException { final CharArrayBuffer buffer = lineFormatter.formatStatusLine (this.lineBuf, ((HttpResponse) message).getStatusLine()); this.sessionBuffer.writeLine(buffer); }
protected void writeHeadLine(final HttpMessage message) throws IOException { final CharArrayBuffer buffer = lineFormatter.formatRequestLine (this.lineBuf, ((HttpRequest) message).getRequestLine()); this.sessionBuffer.writeLine(buffer); }
/** * Writes the cache and bufferToAppend to the underlying stream * as one large chunk * @param bufferToAppend * @param off * @param len * @throws IOException */ protected void flushCacheWithAppend(byte bufferToAppend[], int off, int len) throws IOException { this.out.writeLine(Integer.toHexString(this.cachePosition + len)); this.out.write(this.cache, 0, this.cachePosition); this.out.write(bufferToAppend, off, len); this.out.writeLine(""); this.cachePosition = 0; }
public void write( final HttpMessage message) throws IOException, HttpException { if (message == null) { throw new IllegalArgumentException("HTTP message may not be null"); } writeHeadLine(message); for (Iterator it = message.headerIterator(); it.hasNext(); ) { Header header = (Header) it.next(); this.sessionBuffer.writeLine (lineFormatter.formatHeader(this.lineBuf, header)); } this.lineBuf.clear(); this.sessionBuffer.writeLine(this.lineBuf); }
public void writeLine(final String s) throws IOException { this.out.writeLine(s); if (this.wire.enabled()) { this.wire.output(s + "[EOL]"); } }
public void writeLine(final CharArrayBuffer buffer) throws IOException { this.out.writeLine(buffer); if (this.wire.enabled()) { String s = new String(buffer.buffer(), 0, buffer.length()); this.wire.output(s + "[EOL]"); } }
/** * Writes the cache out onto the underlying stream * @throws IOException */ protected void flushCache() throws IOException { if (this.cachePosition > 0) { this.out.writeLine(Integer.toHexString(this.cachePosition)); this.out.write(this.cache, 0, this.cachePosition); this.out.writeLine(""); this.cachePosition = 0; } }
protected void writeHeadLine(final HttpMessage message) throws IOException { final CharArrayBuffer buffer = lineFormatter.formatStatusLine (this.lineBuf, ((HttpResponse) message).getStatusLine()); this.sessionBuffer.writeLine(buffer); }
@Override protected void writeHeadLine(final HttpRequest message) throws IOException { lineFormatter.formatRequestLine(this.lineBuf, message.getRequestLine()); this.sessionBuffer.writeLine(this.lineBuf); }
protected void writeHeadLine(final HttpMessage message) throws IOException { final CharArrayBuffer buffer = lineFormatter.formatRequestLine (this.lineBuf, ((HttpRequest) message).getRequestLine()); this.sessionBuffer.writeLine(buffer); }
@Override protected void writeHeadLine(final HttpMessage message) throws IOException { lineFormatter.formatRequestLine(this.lineBuf, ((HttpRequest) message).getRequestLine()); this.sessionBuffer.writeLine(this.lineBuf); }
@Override protected void writeHeadLine(final HttpResponse message) throws IOException { lineFormatter.formatStatusLine(this.lineBuf, message.getStatusLine()); this.sessionBuffer.writeLine(this.lineBuf); }
@Override protected void writeHeadLine(final HttpRequest message) throws IOException { lineFormatter.formatRequestLine(this.lineBuf, message.getRequestLine()); this.sessionBuffer.writeLine(this.lineBuf); }
public void writeLine(final String s) throws IOException { this.out.writeLine(s); if (this.wire.enabled()) { this.wire.output(s + "[EOL]"); } }
public void writeLine(final CharArrayBuffer buffer) throws IOException { this.out.writeLine(buffer); if (this.wire.enabled()) { String s = new String(buffer.buffer(), 0, buffer.length()); this.wire.output(s + "[EOL]"); } }