From d20d338a3a3a9323330100a5e913e76ed3217514 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Fri, 28 Nov 2008 14:47:49 +0000 Subject: [PATCH] Clarification on the overhead of throwing an error --- .../jboss/netty/handler/codec/replay/ReplayingDecoder.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java b/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java index 941d74d802..604f6eafc6 100644 --- a/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/replay/ReplayingDecoder.java @@ -99,6 +99,11 @@ import org.jboss.netty.handler.codec.frame.FrameDecoder; * back to the 'initial' position (i.e. the beginning of the buffer) and call * the {@code decode(..)} method again when more data is received into the * buffer. + *

+ * Please note that the overhead of throwing an {@link Error} is minimal unlike + * throwing a new {@link Exception} in an ordinary way. {@link ReplayingDecoder} + * reuses the same {@link Error} instance so that it does not need to fill its + * stack trace, which takes most of {@link Exception} initialization time. * *

Limitations

*