Package org.restlet.engine.io

Examples of org.restlet.engine.io.Buffer


     * @param connection
     *            The parent SSL connection.
     */
    public WritableSslChannel(WritableSelectionChannel target,
            SslConnection<?> connection) {
        super(new Buffer(connection.getPacketBufferSize(), connection
                .getHelper().isDirectBuffers()), target);
        this.connection = connection;
    }
View Full Code Here


     * @param connection
     *            The parent SSL connection.
     */
    public ReadableSslChannel(ReadableSelectionChannel source,
            SslConnection<?> connection) {
        super(null, new Buffer(connection.getPacketBufferSize(), connection
                .getHelper().isDirectBuffers()), source);

        if (Context.getCurrentLogger().isLoggable(Level.FINER)) {
            Context.getCurrentLogger().log(
                    Level.FINER,
View Full Code Here

* @author Jerome Louvel
*/
public class BufferTestCase extends RestletTestCase {

    public void testFlip() throws IOException {
        Buffer buffer = new Buffer(8192);
        buffer.fill("abcdefghijklm");
        buffer.flip();

        for (int i = 0; i < 4; i++) {
            // Drain first characters
            buffer.drain();
        }

        buffer.flip();
        buffer.fill("nopqrst");
        buffer.flip();

        for (int i = 0; i < 4; i++) {
            // Drain first characters
            buffer.drain();
        }

        buffer.flip();
        buffer.fill("uvwxyz");
        buffer.flip();

        StringBuilder sb = new StringBuilder();
        buffer.drain(sb, BufferState.FILLING);
        assertEquals("Remaining buffer", "ijklmnopqrstuvwxyz", sb.toString());
    }
View Full Code Here

     * @param bufferSize
     *            The byte buffer size.
     */
    public Way(Connection<?> connection, int bufferSize) {
        this.connection = connection;
        this.buffer = new Buffer(bufferSize, getHelper().isDirectBuffers());
        this.headers = null;
        this.ioState = IoState.IDLE;
        this.lineBuilder = new StringBuilder();
        this.lineBuilderState = BufferState.IDLE;
        this.message = null;
View Full Code Here

TOP

Related Classes of org.restlet.engine.io.Buffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.