Package org.atmosphere.cpr
Class AsyncIOWriterAdapter
java.lang.Object
org.atmosphere.cpr.AsyncIOWriterAdapter
- All Implemented Interfaces:
AsyncIOWriter
- Direct Known Subclasses:
AtmosphereInterceptorWriter,ByteArrayAsyncWriter
Adapter class for
AsyncIOWriter.- Author:
- Jeanfrancois Arcand
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClose the underlying connection.Flush the buffered content.redirect(AtmosphereResponse r, String location) Redirect a WebSocket request to another location.write(AtmosphereResponse r, byte[] data) Write a WebSocket message.write(AtmosphereResponse r, byte[] data, int offset, int length) Write a WebSocket message.write(AtmosphereResponse r, String data) Write a WebSocket message.writeError(AtmosphereResponse r, int errorCode, String message) Write an error code.
-
Constructor Details
-
AsyncIOWriterAdapter
public AsyncIOWriterAdapter()
-
-
Method Details
-
redirect
Description copied from interface:AsyncIOWriterRedirect a WebSocket request to another location.- Specified by:
redirectin interfaceAsyncIOWriter- Parameters:
location-- Throws:
IOException
-
writeError
public AsyncIOWriter writeError(AtmosphereResponse r, int errorCode, String message) throws IOException Description copied from interface:AsyncIOWriterWrite an error code.- Specified by:
writeErrorin interfaceAsyncIOWriter- Parameters:
errorCode- the error codemessage-- Throws:
IOException
-
write
Description copied from interface:AsyncIOWriterWrite a WebSocket message.- Specified by:
writein interfaceAsyncIOWriter- Parameters:
data- the WebSocket message- Throws:
IOException
-
write
Description copied from interface:AsyncIOWriterWrite a WebSocket message.- Specified by:
writein interfaceAsyncIOWriter- Parameters:
data- the WebSocket message- Throws:
IOException
-
write
public AsyncIOWriter write(AtmosphereResponse r, byte[] data, int offset, int length) throws IOException Description copied from interface:AsyncIOWriterWrite a WebSocket message.- Specified by:
writein interfaceAsyncIOWriter- Parameters:
data- the WebSocket messageoffset- offset of the messagelength- length of the message- Throws:
IOException
-
close
Description copied from interface:AsyncIOWriterClose the underlying connection.- Specified by:
closein interfaceAsyncIOWriter- Throws:
IOException
-
flush
Description copied from interface:AsyncIOWriterFlush the buffered content.- Specified by:
flushin interfaceAsyncIOWriter- Throws:
IOException
-