public String readCStr() throws IOException {

            boolean isAscii = true;

            // short circuit 1 byte strings
            _random[0] = read();
            if (_random[0] == 0) {
                return "";
            }

            _random[1] = read();
            if (_random[1] == 0) {
                final String out = ONE_BYTE_STRINGS[_random[0]];
                return (out != null) ? out : new String(_random, 0, 1, DEFAULT_ENCODING);
            }

            _stringBuffer.reset();
            _stringBuffer.write(_random, 0, 2);

            isAscii = _isAscii(_random[0]) && _isAscii(_random[1]);

            byte b;
            while ((b = read()) != 0) {
                _stringBuffer.write( b );
                isAscii = isAscii && _isAscii( b );
            }

            String out = null;
            if ( isAscii ){
                out = _stringBuffer.asAscii();
            }
            else {
                try {
                    out = _stringBuffer.asString( DEFAULT_ENCODING );
                }
                catch ( UnsupportedOperationException e ){
                    throw new BSONException( "impossible" , e );
                }
            }
            _stringBuffer.reset();
            return out;
        }