| 1076 | |
| 1077 | |
| 1078 | private static class TestInput implements Http2Parser.Input { |
| 1079 | |
| 1080 | private final InputStream is; |
| 1081 | |
| 1082 | |
| 1083 | TestInput(InputStream is) { |
| 1084 | this.is = is; |
| 1085 | } |
| 1086 | |
| 1087 | |
| 1088 | @Override |
| 1089 | public boolean fill(boolean block, byte[] data, int offset, int length) throws IOException { |
| 1090 | // Note: Block is ignored for this test class. Reads always block. |
| 1091 | int off = offset; |
| 1092 | int len = length; |
| 1093 | while (len > 0) { |
| 1094 | int read = is.read(data, off, len); |
| 1095 | if (read == -1) { |
| 1096 | throw new IOException("End of input stream with [" + len + "] bytes left to read"); |
| 1097 | } |
| 1098 | off += read; |
| 1099 | len -= read; |
| 1100 | } |
| 1101 | return true; |
| 1102 | } |
| 1103 | |
| 1104 | |
| 1105 | @Override |
| 1106 | public int getMaxFrameSize() { |
| 1107 | // Hard-coded to use the default |
| 1108 | return ConnectionSettingsBase.DEFAULT_MAX_FRAME_SIZE; |
| 1109 | } |
| 1110 | } |
| 1111 | |
| 1112 | |
| 1113 | public class TestOutput implements Output, HeaderEmitter { |
nothing calls this directly
no outgoing calls
no test coverage detected