List of usage examples for org.apache.http.params HttpProtocolParams getHttpElementCharset
public static String getHttpElementCharset(HttpParams httpParams)
From source file:org.vietspider.net.apache.AbstractSessionInputBuffer.java
protected void init(final InputStream _instream, int buffersize, final HttpParams params) { if (_instream == null) { throw new IllegalArgumentException("Input stream may not be null"); }/* w w w . ja v a 2s . co m*/ if (buffersize <= 0) { throw new IllegalArgumentException("Buffer size may not be negative or zero"); } if (params == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); } this.instream = _instream; this.buffer = new byte[buffersize]; this.bufferpos = 0; this.bufferlen = 0; this.linebuffer = new ByteArrayBuffer(buffersize); this.charset = HttpProtocolParams.getHttpElementCharset(params); // this.timeoutSocket = params.getBooleanParameter("vietspider.socket.timeout", false); this.ascii = this.charset.equalsIgnoreCase(HTTP.US_ASCII) || this.charset.equalsIgnoreCase(HTTP.ASCII); this.maxLineLen = params.getIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, -1); this.metrics = new HttpTransportMetricsImpl(); }
From source file:org.apache.http.impl.conn.DefaultClientConnection.java
@Override protected SessionInputBuffer createSessionInputBuffer(final Socket socket, final int buffersize, final HttpParams params) throws IOException { SessionInputBuffer inbuffer = super.createSessionInputBuffer(socket, buffersize > 0 ? buffersize : 8192, params);//from www . j a v a2s .c om if (wireLog.isDebugEnabled()) { inbuffer = new LoggingSessionInputBuffer(inbuffer, new Wire(wireLog), HttpProtocolParams.getHttpElementCharset(params)); } return inbuffer; }
From source file:org.apache.http.impl.conn.DefaultClientConnection.java
@Override protected SessionOutputBuffer createSessionOutputBuffer(final Socket socket, final int buffersize, final HttpParams params) throws IOException { SessionOutputBuffer outbuffer = super.createSessionOutputBuffer(socket, buffersize > 0 ? buffersize : 8192, params);/*www . j ava2 s . c o m*/ if (wireLog.isDebugEnabled()) { outbuffer = new LoggingSessionOutputBuffer(outbuffer, new Wire(wireLog), HttpProtocolParams.getHttpElementCharset(params)); } return outbuffer; }