class BridgeInputBuilder {

    public List<OneField> makeInput(DataInput inputStream) throws Exception {
        if (protocolData.getOutputFormat() == OutputFormat.TEXT) {
            // Avoid copying the bytes from the inputStream directly. This
            // code used to use the Text class to read bytes until a line
            // delimiter was found. This would cause issues with wide rows that
            // had 1MB+, because the Text code grows the array to fit data, and
            // it does it inefficiently. We observed multiple calls to
            // System.arraycopy in the setCapacity method for every byte after
            // we exceeded the original buffer size. This caused terrible
            // performance in PXF, even when writing a single row to an external
            // system.
            return Collections.singletonList(new OneField(DataType.BYTEA.getOID(), inputStream));
        }

        GPDBWritable gpdbWritable = new GPDBWritable();
        gpdbWritable.readFields(inputStream);

        if (gpdbWritable.isEmpty()) {
            LOG.debug("Reached end of stream");
            return null;
        }

        GPDBWritableMapper mapper = new GPDBWritableMapper(gpdbWritable);
        int[] colTypes = gpdbWritable.getColType();
        List<OneField> record = new LinkedList<>();
        for (int i = 0; i < colTypes.length; i++) {
            mapper.setDataType(colTypes[i]);
            record.add(new OneField(colTypes[i], mapper.getData(i)));
        }

        return record;
    }

    public  BridgeInputBuilder(RequestContext protocolData);

}