bson/src/main/org/bson/AbstractBsonReader.java
protected void checkPreconditions(final String methodName, final BsonType type) {
        if (isClosed()) {
            throw new IllegalStateException("BsonWriter is closed");
        }

        verifyBSONType(methodName, type);
    }
protected void checkPreconditions(final String methodName, final BsonType type) {
        if (isClosed()) {
            throw new IllegalStateException("BsonWriter is closed");
        }

        verifyBSONType(methodName, type);
    }
protected void checkPreconditions ( final String methodName , final BsonType type ) { if ( isClosed ( ) ) { throw new IllegalStateException ( "BsonWriter is closed" ) ; } verifyBSONType ( methodName , type ) ; }
Ensures any conditions are met before reading commences.  Throws exceptions if the conditions are not met.

@param methodName the name of the current method, which will indicate the field being read
@param type       the type of this field
Ensures any conditions are met before reading commences . Throws exceptions if the conditions are not met .