Top Description Inners Methods
io.grpc

public Interface Codec

extends Compressor, Decompressor
Known Direct Implementers
io.grpc.Codec.Gzip, io.grpc.Codec.Identity
Annotations
@ExperimentalApi:https://github.com/grpc/grpc-java/issues/1704
Imports
java.io.IOException, .InputStream, .OutputStream, java.util.zip.GZIPInputStream, .GZIPOutputStream

Encloses classes related to the compression and decompression of messages.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Codec.Gzip

A gzip compressor and decompressor.

public static class
Codec.Identity

The "identity", or "none" codec.

Method Summary

Inherited from io.grpc.Compressor:
compressgetMessageEncoding
Inherited from io.grpc.Decompressor:
decompressgetMessageEncoding
io.grpc back to summary

public final Class Codec.Gzip

extends Object
implements Codec
Class Inheritance
All Implemented Interfaces
io.grpc.Codec, io.grpc.Decompressor, io.grpc.Compressor

A gzip compressor and decompressor. In the future this will likely support other compression methods, such as compression level.

Constructor Summary

AccessConstructor and Description
public
Gzip()

Method Summary

Modifier and TypeMethod and Description
public OutputStream
compress(OutputStream
The output stream of uncompressed data
os
)

Implements io.grpc.Compressor.compress.

Wraps an existing output stream with a compressing output stream.
public InputStream
decompress(InputStream
The input stream of uncompressed data
is
)

Implements io.grpc.Decompressor.decompress.

Wraps an existing input stream with a decompressing input stream.
public String
getMessageEncoding()

Implements io.grpc.Compressor.getMessageEncoding, io.grpc.Decompressor.getMessageEncoding.

Returns the message encoding that this compressor uses.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Gzipback to summary
public Gzip()

Method Detail

compressback to summary
public OutputStream compress(OutputStream os) throws IOException

Implements io.grpc.Compressor.compress.

Doc from io.grpc.Compressor.compress.

Wraps an existing output stream with a compressing output stream.

Parameters
os:OutputStream

The output stream of uncompressed data

Returns:OutputStream

An output stream that compresses

Annotations
@Override
decompressback to summary
public InputStream decompress(InputStream is) throws IOException

Implements io.grpc.Decompressor.decompress.

Doc from io.grpc.Decompressor.decompress.

Wraps an existing input stream with a decompressing input stream.

Parameters
is:InputStream

The input stream of uncompressed data

Returns:InputStream

An input stream that decompresses

Annotations
@Override
getMessageEncodingback to summary
public String getMessageEncoding()

Implements io.grpc.Compressor.getMessageEncoding, io.grpc.Decompressor.getMessageEncoding.

Doc from io.grpc.Compressor.getMessageEncoding.

Returns the message encoding that this compressor uses.

This can be values such as "gzip", "deflate", "snappy", etc.

Annotations
@Override
io.grpc back to summary

public final Class Codec.Identity

extends Object
implements Codec
Class Inheritance
All Implemented Interfaces
io.grpc.Codec, io.grpc.Decompressor, io.grpc.Compressor

The "identity", or "none" codec. This codec is special in that it can be used to explicitly disable Call compression on a Channel that by default compresses.

Field Summary

Modifier and TypeField and Description
public static final Codec
NONE

Special sentinel codec indicating that no compression should be used.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public OutputStream
compress(OutputStream
The output stream of uncompressed data
os
)

Implements io.grpc.Compressor.compress.

Wraps an existing output stream with a compressing output stream.
public InputStream
decompress(InputStream
The input stream of uncompressed data
is
)

Implements io.grpc.Decompressor.decompress.

Wraps an existing input stream with a decompressing input stream.
public String
getMessageEncoding()

Implements io.grpc.Compressor.getMessageEncoding, io.grpc.Decompressor.getMessageEncoding.

Returns the message encoding that this compressor uses.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

NONEback to summary
public static final Codec NONE

Special sentinel codec indicating that no compression should be used. Users should use reference equality to see if compression is disabled.

Constructor Detail

Identityback to summary
private Identity()

Method Detail

compressback to summary
public OutputStream compress(OutputStream os)

Implements io.grpc.Compressor.compress.

Doc from io.grpc.Compressor.compress.

Wraps an existing output stream with a compressing output stream.

Parameters
os:OutputStream

The output stream of uncompressed data

Returns:OutputStream

An output stream that compresses

Annotations
@Override
decompressback to summary
public InputStream decompress(InputStream is)

Implements io.grpc.Decompressor.decompress.

Doc from io.grpc.Decompressor.decompress.

Wraps an existing input stream with a decompressing input stream.

Parameters
is:InputStream

The input stream of uncompressed data

Returns:InputStream

An input stream that decompresses

Annotations
@Override
getMessageEncodingback to summary
public String getMessageEncoding()

Implements io.grpc.Compressor.getMessageEncoding, io.grpc.Decompressor.getMessageEncoding.

Doc from io.grpc.Compressor.getMessageEncoding.

Returns the message encoding that this compressor uses.

This can be values such as "gzip", "deflate", "snappy", etc.

Annotations
@Override