@Override
    public Result detect(ChannelBuffer in) {
        int prefaceLen = Preface.readableBytes();
        int bytesRead = min(in.readableBytes(), prefaceLen);

        if (bytesRead == 0 || !ChannelBuffers.prefixEquals(in, Preface, bytesRead)) {
            return Result.UNRECOGNIZED;
        }
        if (bytesRead == prefaceLen) {
            return Result.RECOGNIZED;
        }

        return Result.NEED_MORE_DATA;
    }
@Test
    void testDetect_NeedMoreData() {
        DubboDetector detector = new DubboDetector();
        ChannelBuffer in = ChannelBuffers.wrappedBuffer(new byte[] {(byte) 0xda});
        assertEquals(DubboDetector.Result.NEED_MORE_DATA, detector.detect(in));
    }