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 .