BinaryEncoder out = ENCODER_FACTORY.binaryEncoder(bao, null); try { out.writeBoolean(true); new SpecificDatumWriter(message.getErrors()).write(response, out); } catch (Exception e) { bao = new ByteArrayOutputStream(); out = ENCODER_FACTORY.binaryEncoder(bao, null); out.writeBoolean(true); new SpecificDatumWriter(Protocol.SYSTEM_ERRORS).write(new Utf8(e.toString()), out); CountingOutputStream outputStream = new CountingOutputStream(target); BinaryEncoder out = ENCODER_FACTORY.binaryEncoder(outputStream, null); out.writeBoolean(false); new SpecificDatumWriter(message.getResponse()).write(response, out); out.flush();
return null; out.writeBoolean(error != null); if (error == null) writeResponse(m.getResponse(), response, out); bbo = new ByteBufferOutputStream(); out = EncoderFactory.get().binaryEncoder(bbo, null); out.writeBoolean(true); writeError(Protocol.SYSTEM_ERRORS, new Utf8(e.toString()), out); if (null == handshake) {
@Override public void writeBoolean(boolean b) throws IOException { wrappedEncoder.writeBoolean(b); }
@Override public void writeBoolean(boolean b) throws IOException { wrappedEncoder.writeBoolean(b); }
@Override public void writeBoolean(boolean b) throws IOException { wrappedEncoder.writeBoolean(b); }
return null; out.writeBoolean(error != null); if (error == null) writeResponse(m.getResponse(), response, out); bbo = new ByteBufferOutputStream(); out = EncoderFactory.get().binaryEncoder(bbo, null); out.writeBoolean(true); writeError(Protocol.SYSTEM_ERRORS, new Utf8(e.toString()), out); if (null == handshake) {
return null; out.writeBoolean(error != null); if (error == null) writeResponse(m.getResponse(), response, out); bbo = new ByteBufferOutputStream(); out = new BinaryEncoder(bbo); out.writeBoolean(true); writeError(Protocol.SYSTEM_ERRORS, new Utf8(e.toString()), out);