private MarcFileReadStatus packBuffer(long uTestSize) throws MarcException {

        if (bufferPosition < dataLength) {
            // Is there at least testsize bytes left ?
            if (uTestSize <= dataLength - bufferPosition) {
                return MarcFileReadStatus.VALID;
            }
        }
        if (readStatus == MarcFileReadStatus.ALLDONE) {
            // If not, is file exhausted?
            if (bufferPosition == dataLength) {
                return MarcFileReadStatus.ALLDONE;
            } else {
                return MarcFileReadStatus.ERROR;
            }
        }

        if (readStatus == MarcFileReadStatus.ERROR) {
            return MarcFileReadStatus.ERROR;
        }

        if(bufferPosition > 0 && !isEOF()) {
            // Move things over
            byte[] interim = buffer;
            buffer = new byte[MarcReaderConstants.BUFFER_SIZE];
            System.arraycopy(interim, bufferPosition, buffer, 0, dataLength - bufferPosition);
            dataLength -= bufferPosition;
            bufferPosition = 0;
        }

        // And get more data
        readDataFromFile();
        if (readStatus == MarcFileReadStatus.ERROR) {
            return MarcFileReadStatus.ERROR;
        }
        return MarcFileReadStatus.VALID;
    }