(Operation op, int length)
| 106 | } |
| 107 | |
| 108 | void push(Operation op, int length) { |
| 109 | if (length < 0) { |
| 110 | throw new IllegalArgumentException("negative block length"); |
| 111 | } |
| 112 | if (context[0] == 0) { |
| 113 | throw new IllegalStateException("brotli encoder is already destroyed"); |
| 114 | } |
| 115 | if (!isSuccess() || hasMoreOutput()) { |
| 116 | throw new IllegalStateException("pushing input to encoder in unexpected state"); |
| 117 | } |
| 118 | if (hasRemainingInput() && length != 0) { |
| 119 | throw new IllegalStateException("pushing input to encoder over previous input"); |
| 120 | } |
| 121 | context[1] = op.ordinal(); |
| 122 | fresh = false; |
| 123 | nativePush(context, length); |
| 124 | } |
| 125 | |
| 126 | boolean isSuccess() { |
| 127 | return context[1] != 0; |
no test coverage detected