Android SessionOutputBuffer - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android SessionOutputBuffer class.

This code example shows how to use the following methods:flush, write, writeLine
    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; 
    } 
 
    protected void writeClosingChunk() throws IOException { 
        // Write the final chunk. 
        this.out.writeLine("0"); 
        this.out.writeLine(""); 
    } 
 
    // ----------------------------------------------------------- Public Methods 
    /** 
     * Must be called to ensure the internal cache is flushed and the closing 
     * chunk is written. 
     * @throws IOException in case of an I/O error 
     */ 

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:flush
                request,
                request.getEntity());
    } 
 
    protected void doFlush() throws IOException { 
        this.outbuffer.flush();
    } 
     
    public void flush() throws IOException { 
        assertOpen(); 
        doFlush(); 
    } 
     
    public HttpResponse receiveResponseHeader() 
            throws HttpException, IOException { 
        assertOpen(); 
        HttpResponse response = (HttpResponse) this.responseParser.parse();
        if (response.getStatusLine().getStatusCode() >= 200) {
            this.metrics.incrementResponseCount();
        } 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:flush
     * will invoke {@link #init(SessionInputBuffer, SessionOutputBuffer, HttpParams)} 
     * method to pass references to those buffers to the underlying HTTP message 
     * parser and formatter. 
     * <p> 
     * After this method's execution the connection status will be reported 
     * as open and the {@link #isOpen()} will return <code>true</code>. 
     * 
     * @param socket the socket. 
     * @param params HTTP parameters. 
     * @throws IOException in case of an I/O error. 
     */ 
    protected void bind(final Socket socket, final HttpParams params) throws IOException {
        if (socket == null) {
            throw new IllegalArgumentException("Socket may not be null");
        } 
        if (params == null) {
            throw new IllegalArgumentException("HTTP parameters may not be null");
        } 
        this.socket = socket;
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:flush
    public void close() throws IOException { 
        if (!this.closed) {
            this.closed = true;
            this.out.flush();
        } 
    } 
 
    @Override 
    public void flush() throws IOException { 
        this.out.flush();
    } 
 
    @Override 
    public void write(final byte[] b, final int off, final int len) throws IOException {
        if (this.closed) {
            throw new IOException("Attempted write to closed stream.");
        } 
        if (this.total < this.contentLength) {
            final long max = this.contentLength - this.total;
            int chunk = len;
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:flush
 
    @Override 
    protected SessionInputBuffer createSessionInputBuffer(
            final Socket socket,
            int buffersize,
            final HttpParams params) throws IOException {
        SessionInputBuffer inbuffer = super.createSessionInputBuffer(
                socket, 
                buffersize,
                params);
        if (wireLog.isDebugEnabled()) {
            inbuffer = new LoggingSessionInputBuffer(inbuffer, new Wire(wireLog));
        } 
        return inbuffer;
    } 
 
     
    @Override 
    protected SessionOutputBuffer createSessionOutputBuffer(
            final Socket socket,
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:flush
 
    public boolean isOpen() { 
        return this.open;
    } 
 
    protected Socket getSocket() {
        return this.socket;
    } 
 
    public InetAddress getLocalAddress() {
        if (this.socket != null) {
            return this.socket.getLocalAddress();
        } else { 
            return null; 
        } 
    } 
 
    public int getLocalPort() { 
        if (this.socket != null) {
            return this.socket.getLocalPort();
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:flush
     */ 
    public void close() throws IOException { 
        if (!this.closed) {
            this.closed = true;
            this.out.flush();
        } 
    } 
 
    public void flush() throws IOException { 
        this.out.flush();
    } 
 
    public void write(byte[] b, int off, int len) throws IOException {
        if (this.closed) {
            throw new IOException("Attempted write to closed stream.");
        } 
        this.out.write(b, off, len);
    } 
 
    public void write(byte[] b) throws IOException {
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:flush
        HttpEntity entity = this.entitydeserializer.deserialize(this.inbuffer, request);
        request.setEntity(entity);
    } 
 
    protected void doFlush() throws IOException  { 
        this.outbuffer.flush();
    } 
     
    public void flush() throws IOException { 
        assertOpen(); 
        doFlush(); 
    } 
     
    public void sendResponseHeader(final HttpResponse response) 
            throws HttpException, IOException { 
        if (response == null) {
            throw new IllegalArgumentException("HTTP response may not be null");
        } 
        assertOpen(); 
        this.responseWriter.write(response);
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:writeLine
    protected void writeHeadLine(final HttpMessage message) 
        throws IOException { 
 
        lineFormatter.formatStatusLine(this.lineBuf, 
                ((HttpResponse) message).getStatusLine()); 
        this.sessionBuffer.writeLine(this.lineBuf); 
    } 
 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:flush
            this.wire.output(b);
        } 
    } 
 
    public void flush() throws IOException { 
        this.out.flush();
    } 
 
    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]");
        } 
    } 
 
    public void writeLine(final String s) throws IOException {
        this.out.writeLine(s);
        if (this.wire.enabled()) {
            this.wire.output(s + "[EOL]");
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Android SessionOutputBuffer Questions & Answers:

See Code Examples for Android SessionOutputBuffer Methods: