InputStream vs BufferedInputStream(InputStream vs BufferedInputStream)
我有以下代码:
httpUrlConnection = (HttpURLConnection) new URL(URL).openConnection(); InputStream in = new BufferedInputStream(httpUrlConnection.getInputStream()); BufferedReader reader = new BufferedReader(new InputStreamReader(in));
我的问题是,我可以用“InputStream in = httpUrlConnection.getInputStream();”替换第二行吗? ? 会有什么不同吗?
I have the following code:
httpUrlConnection = (HttpURLConnection) new URL(URL).openConnection(); InputStream in = new BufferedInputStream(httpUrlConnection.getInputStream()); BufferedReader reader = new BufferedReader(new InputStreamReader(in));
My question is, can I just replace the second line with "InputStream in =httpUrlConnection.getInputStream();" ? will it make any difference?
原文:https://stackoverflow.com/questions/45256942
更新时间:2023-07-06 19:07
最满意答案
我认为你需要剃刀明确的文字标记
<title>My Website @if( string.IsNullOrEmpty( ViewBag.Title) == false){ <text>-</text> @ViewBag.Title}</title>
i think you need razor explicit text markup
<title>My Website @if( string.IsNullOrEmpty( ViewBag.Title) == false){ <text>-</text> @ViewBag.Title}</title>
相关问答
更多-
TCP/IP模型是一个________。[2023-05-19]
a -
在布局中,您不需要围绕RenderSection调用的单引号: 并在视图内: @section DocumentReady { alert(''); } 但是如果在布局中有脚本部分,它可能会更具可读性: @RenderSection( ...
-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
达林的回应解决了您不希望布局应用的实际问题。 关于这两者之间的区别,在Razor中它们实际上是相同的,因为完整页面和部分使用相同的扩展并具有相同的基类。 之所以存在不同的用户界面是因为在Web窗体视图引擎中,这两个用不同的扩展名和不同的基类实现,这就是为什么分离模板是必要的。 Darin's response solves your practical issue of not wanting the layout to be applied. Regarding the difference betwee ...
-
终于找到了答案。 @using MyNamespace 对于VB.Net: @Imports Mynamespace 如果您想在应用程序中包含命名空间,请查看@ Javad_Amiry的答案。 Finally found the answer. @using MyNamespace For VB.Net: @Imports Mynamespace Take a look at @Javad_Amiry's answer if you want to include a namespace acros ...
-
我认为你需要剃刀明确的文字标记
My Website @if( string.IsNullOrEmpty( ViewBag.Title) == false){ i think you need razor explicit text markup- @ViewBag.Title}My Website @if( string.IsNullOrEmpty( ViewBag.Title) == false){ - 这将是非常困难的,以至于我建议寻找另一种方式:(。我希望它更容易,但这些是将新视图引擎集成到现有遗留系统中的复杂性。 如果你真的想尝试一下,为了给你一个良好的开端:你可能需要为你的Razor内容页面创建一个继承自WebViewPage的自定义基类,覆盖一些方法(说实话,我对这个方面不太熟悉)因此,您需要调试以遵循管道),以便不将Layout属性视为布局页面的路径,而是将其视为主页面。 然后你需要实例化主页面并以某种方式转换Sections(它们被Razor解析器转换为对DefineSection的调用,并且 ...经过多次试验并合并其他代码后,我找到了解决方案 使用它可以让您访问页面访问权限,这样您就可以随意使用它,更改标题等。 var pageObj = Context.CurrentHandler as Page; pageObj.Title = "My New Title for the page"; 此代码将允许访问DNN页面,因此您可以插入控件等。 DotNetNuke.Framework.CDefault tp = (DotNetNuke.Framework.CDefault)Context.Curre ...我能够使用Session变量成功地将标题从Controller传递到嵌套的WebForms母版页。 然后我能够在SaveStateComplete之后成功地从嵌套的WebForms母版页更改标题。 会话似乎是唯一的主要数据容器。 I was able to successfully pass the title from the Controller to the nested WebForms Master Page using a Session variable. I was then able to ...在Razor视图中覆盖变量(Override variable in Razor view)[2023-06-18]
只需为该特定客户端编写另一个版本的ToString(..)方法,调用它ToStringForABCInc(...)这样,您可以为其他客户端维护现有的逻辑和视图,并为客户端提供特定的视图和逻辑。特殊要求。 Just write another version of the ToString(..) method for that specific client, calling it ToStringForABCInc(...) That way, you maintain the existing logi ...相关文章
更多- Hadoop小文件操作之SequenceFile
- Hadoop的FileSystem 文件系统实现上传下载文件
- javaIO错误,会的请指点。
- Hadoop 用命令行编译URLCat
- 开发者模式微信公众平台自定义菜单功能
- 微信二次开发Java自定义菜单事件实现
- Hadoop API 学习小结
- Hadoop API 学习笔记
- java jxl 操作excel 时老是这个错误
- HDFS--DFSClient中的读Block机制
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。