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.
| 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected