@Override
        public void read() {
            logger.debug("Reading...");
            // TODO we should read something here, okay?!
            final ChannelConfig config = config();
            final ChannelPipeline pipeline = pipeline();
            final ByteBufAllocator allocator = config.getAllocator();
            final RecvByteBufAllocator.Handle allocHandle = recvBufAllocHandle();
            allocHandle.reset(config);

            boolean close = false;
            try {
                do {
                    ByteBuf byteBuf = allocHandle.allocate(allocator);
                    allocHandle.lastBytesRead(doReadBytes(byteBuf));
                    if (allocHandle.lastBytesRead() <= 0) {
                        // nothing was read. release the buffer.
                        byteBuf.release();
                        byteBuf = null;
                        close = allocHandle.lastBytesRead() < 0;
                        if (close) {
                            // There is nothing left to read as we received an EOF.
                            serialReadPending = false;
                        }
                        break;
                    }

                    allocHandle.incMessagesRead(1);
                    serialReadPending = false;
                    pipeline.fireChannelRead(byteBuf);
                } while (allocHandle.continueReading());

                allocHandle.readComplete();
                pipeline.fireChannelReadComplete();

                if (close) {
                    // TODO
                    //closeOnRead(pipeline);
                }
            } catch (Throwable t) {
                // TODO
                // handleReadException(pipeline, byteBuf, t, close, allocHandle);
                t.printStackTrace();
            } finally {
                // Check if there is a serialReadPending which was not processed yet.
                // This could be for two reasons:
                // * The user called Channel.read() or ChannelHandlerContext.read() in channelRead(...) method
                // * The user called Channel.read() or ChannelHandlerContext.read() in channelReadComplete(...) method
                //
                // See https://github.com/netty/netty/issues/2254
                if (!serialReadPending && !config.isAutoRead()) {
                    // TODO
                }
            }
        }
Create a new instance

@param parent the parent {@link Channel} by which this instance was created. May be {@code null}
@param ch     the underlying {@link SelectableChannel} on which it operates
plc4j/transports/serial/src/main/java/org/apache/plc4x/java/transport/serial/SerialChannel.java