getLogger().write(buffer, 3, dataLength);
if (currentLogger != null) currentLogger.write(buffer, 3, dataLength);
    public void queueService(GDS gds, IscSvcHandle handle) throws GDSException, FBSQLException, IOException {        ServiceRequestBuffer infoSRB = gds.createServiceRequestBuffer(ISCConstants.isc_info_svc_to_eof);        int bufferSize = BUFFER_SIZE;                byte[] buffer = new byte[bufferSize];                boolean processing = true;        while (processing) {            gds.iscServiceQuery(handle, gds.createServiceParameterBuffer() , infoSRB, buffer);                switch(buffer[0]) {                            case ISCConstants.isc_info_svc_to_eof :                                    int dataLength = (buffer[1] & 0xff) | ((buffer[2] & 0xff) << 8);                    if (dataLength == 0) {                        if (buffer[3] != ISCConstants.isc_info_end)                            throw new FBSQLException("Unexpected end of stream reached.");                        else {                            processing = false;                            break;                        }                    }                    getLogger().write(buffer, 3, dataLength);                    break;                                    case ISCConstants.isc_info_truncated :                    bufferSize = bufferSize * 2;                    buffer = new byte[bufferSize];                    break;                                    case ISCConstants.isc_info_end :                     processing = false;                    break;            }        }    }