org.atmosphere.util
Class ByteArrayAsyncWriter

java.lang.Object
  extended by org.atmosphere.cpr.AsyncIOWriterAdapter
      extended by org.atmosphere.util.ByteArrayAsyncWriter
All Implemented Interfaces:
AsyncIOWriter

public class ByteArrayAsyncWriter
extends AsyncIOWriterAdapter

An AsyncIOWriter backed by an ByteArrayOutputStream

Author:
Jeanfrancois Arcand

Constructor Summary
ByteArrayAsyncWriter()
           
 
Method Summary
 void close(AtmosphereResponse r)
          No OPS
 ByteArrayOutputStream stream()
           
 AsyncIOWriter write(AtmosphereResponse r, byte[] data)
          No OPS
 AsyncIOWriter write(AtmosphereResponse r, byte[] data, int offset, int length)
          No OPS
 AsyncIOWriter write(AtmosphereResponse r, String data)
          No OPS
 
Methods inherited from class org.atmosphere.cpr.AsyncIOWriterAdapter
close, flush, flush, redirect, redirect, write, write, write, writeError, writeError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayAsyncWriter

public ByteArrayAsyncWriter()
Method Detail

write

public AsyncIOWriter write(AtmosphereResponse r,
                           String data)
                    throws IOException
Description copied from class: AsyncIOWriterAdapter
No OPS

Specified by:
write in interface AsyncIOWriter
Overrides:
write in class AsyncIOWriterAdapter
data - the WebSocket message
Throws:
IOException

write

public AsyncIOWriter write(AtmosphereResponse r,
                           byte[] data)
                    throws IOException
Description copied from class: AsyncIOWriterAdapter
No OPS

Specified by:
write in interface AsyncIOWriter
Overrides:
write in class AsyncIOWriterAdapter
data - the WebSocket message
Throws:
IOException

write

public AsyncIOWriter write(AtmosphereResponse r,
                           byte[] data,
                           int offset,
                           int length)
                    throws IOException
Description copied from class: AsyncIOWriterAdapter
No OPS

Specified by:
write in interface AsyncIOWriter
Overrides:
write in class AsyncIOWriterAdapter
data - the WebSocket message
offset - offset of the message
length - length if the message
Throws:
IOException

stream

public ByteArrayOutputStream stream()

close

public void close(AtmosphereResponse r)
Description copied from class: AsyncIOWriterAdapter
No OPS

Specified by:
close in interface AsyncIOWriter
Overrides:
close in class AsyncIOWriterAdapter


Copyright © 2012. All Rights Reserved.