缓冲读取器中的readline

时间:2016-03-03 15:16:36

标签: java bufferedreader

我使用readline()方法读取缓冲区读取器的第一行 然后,在检查第一行中的某些内容后,我想将缓冲区读取器发送到函数中,而不会丢失第一行, 据我所知,readline()方法,寻求第一行缓冲读取器, 我该怎么扭转呢?

BufferedReader bufferedReader = new BufferedReader(serverinput);
String onelineofinput = bufferedReader.readLine();
if(onelineofinput...)
...
  then
  sendpackets(IPaddress, port, bufferedReader, connection);
  //bufferedreader should send completely here.

1 个答案:

答案 0 :(得分:1)

您可以在 <?php echo get_post_meta( $post_id,'the_price',); ?> 和输入之间创建if ( ! function_exists( 'avada_render_rollover' ) ) { function avada_render_rollover( $post_id, $post_permalink = '', $display_woo_price = false, $display_woo_buttons = false, $display_post_categories = 'default', $display_post_title = 'default', $gallery_id = '' ) { // Retrieve the permalink if it is not set if ( ! $post_permalink ) { $post_permalink = get_permalink( $post_id ); } // Check if theme options are used as base or if there is an override for post categories if ( 'enable' == $display_post_categories ) { $display_post_categories = true; } elseif ( 'disable' == $display_post_categories ) { $display_post_categories = false; } else { $display_post_categories = ! Avada()->settings->get( 'cats_image_rollover' ); } // Check if theme options are used as base or if there is an override for post title if ( 'enable' == $display_post_title ) { $display_post_title = true; } elseif ( 'disable' == $display_post_title ) { $display_post_title = false; } else { $display_post_title = ! Avada()->settings->get( 'title_image_rollover' ); } // Set the link on the link icon to a custom url if set in page options $icon_permalink = ( fusion_get_page_option( 'link_icon_url', $post_id ) != null ) ? fusion_get_page_option( 'link_icon_url', $post_id ) : $post_permalink; if ( '' == fusion_get_page_option( 'image_rollover_icons', $post_id ) || 'default' == fusion_get_page_option( 'image_rollover_icons', $post_id ) ) { if( ! Avada()->settings->get( 'link_image_rollover' ) && ! Avada()->settings->get( 'zoom_image_rollover' ) ) { // link + zoom $image_rollover_icons = 'linkzoom'; } elseif( ! Avada()->settings->get( 'link_image_rollover' ) && Avada()->settings->get( 'zoom_image_rollover' ) ) { // link $image_rollover_icons = 'link'; } elseif( Avada()->settings->get( 'link_image_rollover' ) && ! Avada()->settings->get( 'zoom_image_rollover' ) ) { // zoom $image_rollover_icons = 'zoom'; } elseif( Avada()->settings->get( 'link_image_rollover' ) && Avada()->settings->get( 'zoom_image_rollover' ) ) { // link $image_rollover_icons = 'no'; } else { $image_rollover_icons = 'linkzoom'; } } else { $image_rollover_icons = fusion_get_page_option( 'image_rollover_icons', $post_id ); } // Set the link target to blank if the option is set $link_target = ( 'yes' == fusion_get_page_option( 'link_icon_target', $post_id ) || 'yes' == fusion_get_page_option( 'post_links_target', $post_id ) ) ? ' target="_blank"' : ''; ?> <div class="fusion-rollover"> <div class="fusion-rollover-content"> <?php if ( 'no' != $image_rollover_icons && 'product' != get_post_type( $post_id ) ) : // Check if rollover icons should be displayed ?> <?php if ( 'zoom' != $image_rollover_icons ) : // If set, render the rollover link icon ?> <a class="fusion-rollover-link" href="<?php echo $icon_permalink; ?>"<?php echo $link_target; ?>>Permalink</a> <?php endif; ?> <?php if ( 'link' != $image_rollover_icons ) : // If set, render the rollover zoom icon ?> <?php // Get the image data $full_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'full' ); if ( ! is_array( $full_image ) ) { $full_image = array(); $full_image[0] = ''; } // If a video url is set in the post options, use it inside the lightbox if ( fusion_get_page_option( 'video_url', $post_id ) ) { $full_image[0] = fusion_get_page_option( 'video_url', $post_id ); } ?> <?php if ( 'linkzoom' == $image_rollover_icons || '' === $image_rollover_icons ) : // If both icons will be shown, add a separator ?> <div class="fusion-rollover-sep"></div> <?php endif; ?> <?php if ( $full_image[0] ) : // Render the rollover zoom icon if we have an image ?> <?php // Only show images of the clicked post if ( 'individual' == Avada()->settings->get( 'lightbox_behavior' ) ) { $lightbox_content = avada_featured_images_lightbox( $post_id ); $data_rel = sprintf( 'iLightbox[gallery%s]', $post_id ); // Show the first image of every post on the archive page } else { $lightbox_content = ''; $data_rel = sprintf( 'iLightbox[gallery%s]', $gallery_id ); } ?> <a class="fusion-rollover-gallery" href="<?php echo $full_image[0]; ?>" data-id="<?php echo $post_id; ?>" data-rel="<?php echo $data_rel; ?>" data-title="<?php echo get_post_field( 'post_title', get_post_thumbnail_id( $post_id ) ); ?>" data-caption="<?php echo get_post_field( 'post_excerpt', get_post_thumbnail_id( $post_id ) ); ?>">Gallery</a><?php echo $lightbox_content; ?> <?php endif; ?> <?php endif; ?> <?php endif; ?> <?php if ( $display_post_title ) : // Check if we should render the post title on the rollover ?> <h4 class="fusion-rollover-title"><a href="<?php echo $icon_permalink; ?>"<?php echo $link_target; ?>><?php echo get_the_title( $post_id ); ?></a></h4> <?php endif; ?> <?php // Check if we should render the post categories on the rollover if ( $display_post_categories ) { // Determine the correct taxonomy if ( 'post' == get_post_type( $post_id ) ) { $post_taxonomy = 'category'; } elseif ( 'avada_portfolio' == get_post_type( $post_id ) ) { $post_taxonomy = 'portfolio_category'; } elseif ( 'product' == get_post_type( $post_id ) ) { $post_taxonomy = 'product_cat'; } echo get_the_term_list( $post_id, $post_taxonomy, '<div class="fusion-rollover-categories">', ', ', '</div>' ); } ?> <?php if ( $display_woo_price ) : // Check if we should render the woo product price ?> <?php woocommerce_get_template( 'loop/price.php' ); ?> <?php endif; ?> <?php if ( $display_woo_buttons ) : // Check if we should render the woo "add to cart" and "details" buttons ?> <div class="fusion-product-buttons"> <?php woocommerce_get_template( 'loop/add-to-cart.php' ); ?> <span class="fusion-rollover-linebreak"></span> <a class="fusion-show-details-button" href="<?php echo post_permalink(); ?>"><?php _e( 'Details', 'Avada' ); ?></a> </div> <?php endif; ?> </div> </div> <?php } }

检查完第一行后,将其推回java.io.PushbackReader(以及BufferedReader吞下的换行符),然后将PushbackReader传递给{{ 1}}。

BufferedReader