Codota Logo
StreamingEncoder
Code IndexAdd Codota to your IDE (free)

How to use
StreamingEncoder
in
de.huxhorn.sulky.codec.streaming

Best Java code snippets using de.huxhorn.sulky.codec.streaming.StreamingEncoder (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec

  @Override
  public void encode(E obj, OutputStream into) throws IOException
  {
    encoder.encode(obj, into);
  }
}
origin: huxi/sulky

  @Override
  public void encode(E obj, OutputStream into) throws IOException
  {
    encoder.encode(obj, into);
  }
}
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec

  @Override
  public void encode(E obj, OutputStream into) throws IOException
  {
    GZIPOutputStream gos=new GZIPOutputStream(into);
    wrapped.encode(obj, gos);
    gos.finish();
  }
}
origin: huxi/sulky

  @Override
  public void encode(E obj, OutputStream into) throws IOException
  {
    GZIPOutputStream gos=new GZIPOutputStream(into);
    wrapped.encode(obj, gos);
    gos.finish();
  }
}
origin: huxi/sulky

  @Override
  @SuppressWarnings("PMD.ReturnEmptyArrayRatherThanNull")
  public byte[] encode(E object)
  {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    try
    {
      wrapped.encode(object, bos);
      return bos.toByteArray();
    }
    catch (IOException e)
    {
      if(logger.isWarnEnabled()) logger.warn("Exception while encoding {}!", object, e);
    }
    return null;
  }
}
origin: de.huxhorn.sulky/de.huxhorn.sulky.codec

  @Override
  @SuppressWarnings("PMD.ReturnEmptyArrayRatherThanNull")
  public byte[] encode(E object)
  {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    try
    {
      wrapped.encode(object, bos);
      return bos.toByteArray();
    }
    catch (IOException e)
    {
      if(logger.isWarnEnabled()) logger.warn("Exception while encoding {}!", object, e);
    }
    return null;
  }
}
origin: huxi/sulky

  @Test
  public void test() throws IOException
  {
    String obj = "Foo";
    StreamingEncoder<String> encoder = new GZIPStreamingEncoderWrapper<>(new StreamingSerializableCodec<>());
    StreamingDecoder<String> decoder = new GZIPStreamingDecoderWrapper<>(new StreamingSerializableCodec<>());
    ByteArrayOutputStream bos=new ByteArrayOutputStream();
    encoder.encode(obj, bos);
    ByteArrayInputStream bis=new ByteArrayInputStream(bos.toByteArray());
    String decoded = decoder.decode(bis);
    assertEquals(obj, decoded);
  }
}
de.huxhorn.sulky.codec.streamingStreamingEncoder

Most used methods

  • encode

Popular in Java

  • Making http post requests using okhttp
  • getResourceAsStream (ClassLoader)
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now