private boolean isStreamPresentAndWritable(int streamId) {
        final Http2Stream stream = encoder.connection().stream(streamId);
        if (stream == null) {
            return false;
        }

        switch (stream.state()) {
            case RESERVED_LOCAL:
            case OPEN:
            case HALF_CLOSED_REMOTE:
                return true;
            default:
                // The response has been sent already.
                return false;
        }
    }
private boolean isStreamPresentAndWritable ( int streamId ) { final Http2Stream stream = encoder . connection ( ) . stream ( streamId ) ; if ( stream == null ) { return false ; } switch ( stream . state ( ) ) { case RESERVED_LOCAL : case OPEN : case HALF_CLOSED_REMOTE : return true ; default : return false ; } }
Returns {@code true} if the stream with the given {@code streamId} has been created and is writable.
Note that this method will return {@code false} for the stream which was not created yet.