Hi, I would strongly recommend not to convert the byte array into a string, just to determine the size, a byte array has a length attribute (and first converting it into a String would triple the memory consumption (the original byte array plus the String (which uses two bytes per character)) which might be an issue here). Another question would be the definition of "size" in this case, however. Is this the number of bytes in the data stream, or the number of characters? Depending on the character set and the content this might differ.
Best regards Stephan -----Original Message----- From: souciance [mailto:souciance.eqdam.ras...@gmail.com] Sent: Montag, 13. Februar 2017 12:25 To: users@camel.apache.org Subject: Re: Netty4 HL7 - reject messages larger than a specified size Just a guess, but can't you convert the byte array into a string and verify the size? On Mon, Feb 13, 2017 at 12:10 PM, slew77 [via Camel] < ml-node+s465427n5793826...@n5.nabble.com> wrote: > Hi, > > Please can someone help with this? > > Thanks, > Steve. > > ------------------------------ > If you reply to this email, your message will be added to the > discussion > below: > http://camel.465427.n5.nabble.com/Netty4-HL7-reject- > messages-larger-than-a-specified-size-tp5793695p5793826.html > To start a new topic under Camel - Users, email > ml-node+s465427n465428...@n5.nabble.com > To unsubscribe from Camel - Users, click here > <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsu > bscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpb > C5jb218NDY1NDI4fDE1MzI5MTE2NTY=> > . > NAML > <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macr > o_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namesp > aces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.vi > ew.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble% > 3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%2 > 1nabble%3Aemail.naml> > -- View this message in context: http://camel.465427.n5.nabble.com/Netty4-HL7-reject-messages-larger-than-a-specified-size-tp5793695p5793827.html Sent from the Camel - Users mailing list archive at Nabble.com.