Class UTF8Checker
- java.lang.Object
-
- io.undertow.websockets.core.protocol.version07.UTF8Checker
-
- All Implemented Interfaces:
ChannelFunction
public class UTF8Checker extends java.lang.Object implements ChannelFunction
An utility class which can be used to check if a sequence of bytes or ByteBuffers contain non UTF-8 data.Please use a new instance per stream.
- Author:
- Norman Maurer
-
-
Constructor Summary
Constructors Constructor Description UTF8Checker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterRead(java.nio.ByteBuffer buf, int position, int length)Is called on theByteBufferafter a read operation completesvoidbeforeWrite(java.nio.ByteBuffer buf, int position, int length)Is called on theByteBufferbefore a write operation completesvoidcomplete()Is called to complete theChannelFunction.voidnewFrame(FrameHeaderData headerData)
-
-
-
Method Detail
-
newFrame
public void newFrame(FrameHeaderData headerData)
- Specified by:
newFramein interfaceChannelFunction
-
afterRead
public void afterRead(java.nio.ByteBuffer buf, int position, int length) throws java.io.IOExceptionDescription copied from interface:ChannelFunctionIs called on theByteBufferafter a read operation completes- Specified by:
afterReadin interfaceChannelFunction- Parameters:
buf- theByteBufferto operate onposition- the index in theByteBufferto start fromlength- the number of bytes to operate on- Throws:
java.io.IOException- thrown if an error occurs
-
beforeWrite
public void beforeWrite(java.nio.ByteBuffer buf, int position, int length) throws java.io.UnsupportedEncodingExceptionDescription copied from interface:ChannelFunctionIs called on theByteBufferbefore a write operation completes- Specified by:
beforeWritein interfaceChannelFunction- Parameters:
buf- theByteBufferto operate onposition- the index in theByteBufferto start fromlength- the number of bytes to operate on- Throws:
java.io.UnsupportedEncodingException
-
complete
public void complete() throws java.io.UnsupportedEncodingExceptionDescription copied from interface:ChannelFunctionIs called to complete theChannelFunction. Access it after complete is called may result in unexpected behavior.- Specified by:
completein interfaceChannelFunction- Throws:
java.io.UnsupportedEncodingException
-
-