MCPcopy Create free account
hub / github.com/apache/thrift / thriftRequest

Method thriftRequest

lib/js/test/src/test/Httpd.java:209–233  ·  view source on GitHub ↗
(byte[] input)

Source from the content-addressed store, hash-verified

207 }
208
209 private String thriftRequest(byte[] input){
210 try{
211
212 //Input
213 TMemoryBuffer inbuffer = new TMemoryBuffer(input.length);
214 inbuffer.write(input);
215 TProtocol inprotocol = new TJSONProtocol(inbuffer);
216
217 //Output
218 TMemoryBuffer outbuffer = new TMemoryBuffer(100);
219 TProtocol outprotocol = new TJSONProtocol(outbuffer);
220
221 TProcessor processor = new ThriftTest.Processor(new TestHandler());
222 processor.process(inprotocol, outprotocol);
223
224 byte[] output = new byte[outbuffer.length()];
225 outbuffer.readAll(output, 0, output.length);
226
227 return new String(output,"UTF-8");
228 }catch(Throwable t){
229 return "Error:"+t.getMessage();
230 }
231
232
233 }
234
235 }
236

Callers 1

handleMethod · 0.95

Calls 5

writeMethod · 0.95
processMethod · 0.95
lengthMethod · 0.95
readAllMethod · 0.95
getMessageMethod · 0.45

Tested by

no test coverage detected