congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ByteArrayAsyncWriter.close
Code IndexAdd Tabnine to your IDE (free)

How to use
close
method
in
org.atmosphere.util.ByteArrayAsyncWriter

Best Java code snippets using org.atmosphere.util.ByteArrayAsyncWriter.close (Showing top 5 results out of 315)

origin: Atmosphere/atmosphere

protected byte[] transform(AtmosphereResponse response, byte[] b, int offset, int length) throws IOException {
  AsyncIOWriter a = response.getAsyncIOWriter();
  // NOTE #1961 for now, create a new buffer par transform call and release it after the transform call.
  //      Alternatively, we may cache the buffer in thread-local and use it while this thread invokes
  //      multiple writes and release it when this thread invokes the close method.
  ByteArrayAsyncWriter buffer = new ByteArrayAsyncWriter();
  try {
    response.asyncIOWriter(buffer);
    invokeInterceptor(response, b, offset, length);
    return buffer.stream().toByteArray();
  } finally {
    buffer.close(null);
    response.asyncIOWriter(a);
  }
}
origin: Atmosphere/nettosphere

protected byte[] transform(AtmosphereResponse response, byte[] b, int offset, int length) throws IOException {
  AsyncIOWriter a = response.getAsyncIOWriter();
  try {
    response.asyncIOWriter(transformCacheBuffer);
    invokeInterceptor(response, b, offset, length);
    return transformCacheBuffer.stream().toByteArray();
  } finally {
    transformCacheBuffer.close(null);
    response.asyncIOWriter(a);
  }
}
origin: Atmosphere/atmosphere-play

protected byte[] transform(AtmosphereResponse response, byte[] b, int offset, int length) throws IOException {
  AsyncIOWriter a = response.getAsyncIOWriter();
  try {
    response.asyncIOWriter(buffer);
    invokeInterceptor(response, b, offset, length);
    return buffer.stream().toByteArray();
  } finally {
    buffer.close(null);
    response.asyncIOWriter(a);
  }
}
origin: org.atmosphere/nettosphere

protected byte[] transform(AtmosphereResponse response, byte[] b, int offset, int length) throws IOException {
  AsyncIOWriter a = response.getAsyncIOWriter();
  try {
    response.asyncIOWriter(transformCacheBuffer);
    invokeInterceptor(response, b, offset, length);
    return transformCacheBuffer.stream().toByteArray();
  } finally {
    transformCacheBuffer.close(null);
    response.asyncIOWriter(a);
  }
}
origin: Atmosphere/atmosphere-vertx

protected byte[] transform(AtmosphereResponse response, byte[] b, int offset, int length) throws IOException {
  AsyncIOWriter a = response.getAsyncIOWriter();
  try {
    response.asyncIOWriter(buffer);
    invokeInterceptor(response, b, offset, length);
    return buffer.stream().toByteArray();
  } finally {
    buffer.close(null);
    response.asyncIOWriter(a);
  }
}
org.atmosphere.utilByteArrayAsyncWriterclose

Popular methods of ByteArrayAsyncWriter

  • stream
  • <init>

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • startActivity (Activity)
  • findViewById (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now