Examples of ChannelReader


Examples of ch.unifr.nio.framework.transform.ChannelReader

        int remotePort = socket.getPort();
        SSLEngine sslEngine =
                sslContext.createSSLEngine(remoteAddress, remotePort);
        sslEngine.setUseClientMode(true);

        channelReader = new ChannelReader(false, 1024, 10240);
        channelReader.setChannel(channel);
        channelWriter = new ChannelWriter(false);
        channelWriter.setChannel(channel);

        // set up output transformation chain:
View Full Code Here

Examples of ch.unifr.nio.framework.transform.ChannelReader

        private HandlerAdapter handlerAdapter;
        private final long start;

        public BenchmarkChannelHandler(int bufferSize) {
            // for plaintext connections it is better to use direct buffers
            reader = new ChannelReader(true/*direct*/,
                    bufferSize/*initial capacity*/,
                    bufferSize * 10/*max capacity*/);
            writer = new ChannelWriter(true/*direct*/);
            writer.addBufferSizeListener(this);
            // hardwire reader -> writer
View Full Code Here

Examples of ch.unifr.nio.framework.transform.ChannelReader

        int receiveBufferSize = socket.getReceiveBufferSize();
        receiveBufferSize = 3000;
        final int SEND_BUFFER_SIZE = 3000;

        // setup input chain
        reader = new ChannelReader(true/*direct*/,
                receiveBufferSize/*initial capacity*/,
                receiveBufferSize * 10/*max capacity*/);
        reader.setNextForwarder(new BenchmarkClientTransformer());

        // setup output chain
View Full Code Here

Examples of ch.unifr.nio.framework.transform.ChannelReader

        ConsoleHandler consoleHandler = new ConsoleHandler();
        consoleHandler.setLevel(Level.FINEST);
        nioLogger.addHandler(consoleHandler);

        // setup input chain
        reader = new ChannelReader(false/*direct*/,
                1024/*initial capacity*/, 10240/*max capacity*/);
        ByteBufferToStringTransformer byteBufferToStringTransformer =
                new ByteBufferToStringTransformer();
        reader.setNextForwarder(byteBufferToStringTransformer);
        byteBufferToStringTransformer.setNextForwarder(
View Full Code Here

Examples of ch.unifr.nio.framework.transform.ChannelReader

     * capacity = 1 kbyte, max capacity = 10 kbyte) </li> <li> channelWriter:
     * non-direct {@link ChannelWriter} </li> <li> stores a reference to its {@link HandlerAdapter}
     * for changing interest ops </li> </ul>
     */
    public AbstractChannelHandler() {
        channelReader = new ChannelReader(false, 1024, 10240);
        channelWriter = new ChannelWriter(false);
    }
View Full Code Here

Examples of ch.unifr.nio.framework.transform.ChannelReader

     * incomplete write operations, otherwise a non-direct buffer
     */
    public AbstractChannelHandler(boolean directReading,
            int initialReadingCapacity, int maxReadingCapacity,
            boolean directWriting) {
        channelReader = new ChannelReader(directReading,
                initialReadingCapacity, maxReadingCapacity);
        channelWriter = new ChannelWriter(directWriting);
    }
View Full Code Here

Examples of ch.unifr.nio.framework.transform.ChannelReader

        // establish input transformation chain:
        // reader -> sslInput
        sslInputForwarder = new SSLInputForwarder(sslEngine);
        sslInputForwarder.setHandshakeNotifier(handshakeNotifier);
        channelReader = new ChannelReader(
                false, initialReaderBufferSize, maxReaderBufferSize);
        channelReader.setNextForwarder(sslInputForwarder);

        // establish output transformation chain:
        // byteBufferToArray -> sslOutput -> channelWriter
View Full Code Here

Examples of gnu.java.nio.ChannelReader

   * given decoder.
   */
  public static Reader newReader(ReadableByteChannel ch, CharsetDecoder dec,
                                 int minBufferCap)
  {
    return new ChannelReader(ch, dec, minBufferCap);
  }
View Full Code Here

Examples of krati.io.ChannelReader

     * @throws IOException
     */
    public void load(File file) throws IOException {
        _entryFile = file;
        Chronos c = new Chronos();
        ChannelReader in = new ChannelReader(file);

        try {
            in.open();

            // Read entry head
            long fileVersion = in.readLong();
            if (fileVersion != STORAGE_VERSION) {
                throw new RuntimeException("Wrong storage version " + fileVersion + " encounted in " + file.getAbsolutePath() + ". Version " + STORAGE_VERSION
                        + " expected.");
            }

            long minScnHead = in.readLong();
            long maxScnHead = in.readLong();
            int length = in.readInt();

            // Read entry body
            loadDataSection(in, length);

            // Read entry tail
            long minScnTail = in.readLong();
            long maxScnTail = in.readLong();

            if (minScnHead != minScnTail) {
                throw new IOException("min scns don't match: " + minScnHead + " vs " + minScnTail);
            }
            if (maxScnHead != maxScnTail) {
                throw new IOException("max scns don't match:" + maxScnHead + " vs " + maxScnTail);
            }

            _minScn = minScnHead;
            _maxScn = maxScnHead;

            if(_log.isInfoEnabled()) {
                _log.info("loaded entry: minScn=" + _minScn + " maxScn=" + _maxScn + " size=" + size() + " file=" + file.getName() + " in " + c.getElapsedTime());
            }
        } finally {
            in.close();
        }
    }
View Full Code Here

Examples of krati.io.ChannelReader

*/
public class TestChannelReaderMappedWriter extends AbstractTestDataRW {
   
    @Override
    protected DataReader createDataReader(File file) {
        return new ChannelReader(file);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.