MCPcopy Create free account
hub / github.com/grpc/grpc-java / Identity

Class Identity

api/src/main/java/io/grpc/Codec.java:56–79  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

54 * disable Call compression on a Channel that by default compresses.
55 */
56 final class Identity implements Codec {
57 /**
58 * Special sentinel codec indicating that no compression should be used. Users should use
59 * reference equality to see if compression is disabled.
60 */
61 public static final Codec NONE = new Identity();
62
63 @Override
64 public InputStream decompress(InputStream is) {
65 return is;
66 }
67
68 @Override
69 public String getMessageEncoding() {
70 return "identity";
71 }
72
73 @Override
74 public OutputStream compress(OutputStream os) {
75 return os;
76 }
77
78 private Identity() {}
79 }
80}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected