@Override public Object parse(InputStream stream) { try { if (message.isOneWay()) return null; BinaryDecoder in = DECODER_FACTORY.binaryDecoder(stream, null); if (!in.readBoolean()) { Object response = new SpecificDatumReader(message.getResponse()).read(null, in); return response; } else { Object value = new SpecificDatumReader(message.getErrors()).read(null, in); if (value instanceof Exception) { return value; } return new AvroRuntimeException(value.toString()); } } catch (IOException e) { throw Status.INTERNAL.withCause(e). withDescription("Error deserializing avro response").asRuntimeException(); } finally { AvroGrpcUtils.skipAndCloseQuietly(stream); } }
context.setResponseCallMeta(META_READER.read(null, in)); if (!in.readBoolean()) { // no error Object response = readResponse(rm.getResponse(), lm.getResponse(), in); context.setResponse(response);
@Override public boolean readBoolean() throws IOException { return wrappedDecoder.readBoolean(); }
@Override public JsonToken decodeBoolean() throws IOException { return _decoder.readBoolean() ? JsonToken.VALUE_TRUE : JsonToken.VALUE_FALSE; }
@Override protected JsonToken readValue(AvroParserImpl parser, BinaryDecoder decoder) throws IOException { return decoder.readBoolean() ? JsonToken.VALUE_TRUE : JsonToken.VALUE_FALSE; } }
@Override public boolean readBoolean() throws IOException { return wrappedDecoder.readBoolean(); }
@Override public boolean readBoolean() throws IOException { return wrappedDecoder.readBoolean(); }
context.setResponseCallMeta(META_READER.read(null, in)); if (!in.readBoolean()) { // no error Object response = readResponse(rm.getResponse(), lm.getResponse(), in); context.setResponse(response);
context.setRequestCallMeta(META_READER.read(null, in)); if (!in.readBoolean()) { // no error Object response = readResponse(m.getResponse(), in); context.setResponse(response);
if (!in.readBoolean()) { // no error Object response = readResponse(rm.getResponse(), in); context.setResponse(response);