Java PushbackInputStream markSupported()方法與示例

PushbackInputStream類markSupported()方法 (PushbackInputStream Class markSupported() method)

  • markSupported() method is available in java.io package.

    markSupported()方法在java.io包中可用。

  • markSupported() method is used to check whether this stream supports mark(), reset() or not.

    markSupported()方法用于檢查此流是否支持mark(),reset()。

  • markSupported() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.

    markSupported()方法是一種非靜態方法,只能通過類對象訪問,如果嘗試使用類名稱訪問該方法,則會收到錯誤消息。

  • markSupported() method does not throw an exception at the time of checking supporting methods.

    在檢查支持方法時, markSupported()方法不會引發異常。

Syntax:

句法:

    public boolean markSupported();

Parameter(s):

參數:

  • It does not accept any parameter.

    它不接受任何參數。

Return value:

返回值:

The return type of the method is boolean, it returns true when this stream support mark() method otherwise it returns false.

方法的返回類型為boolean ,當此流支持mark()方法時返回true,否則返回false。

Example:

例:

// Java program to demonstrate the example 
// of boolean markSupported() method of
// PushbackInputStream
import java.io.*;
public class MarkSupportedOfPBIS {
public static void main(String[] args) throws Exception {
byte[] b_arr = {
97,
98,
99,
100
};
InputStream is_stm = null;
PushbackInputStream pb_stm = null;
try {
// Instantiates ByteArrayOutputStream and PushbackInputStream
is_stm = new ByteArrayInputStream(b_arr);
pb_stm = new PushbackInputStream(is_stm);
// By using markSupported() method is to
// check whether this stream supports
// mark() method or not
boolean status = pb_stm.markSupported();
System.out.println("pb_stm.markSupported(): " + status);
} catch (Exception ex) {
System.out.println(ex.toString());
} finally {
if (is_stm != null)
is_stm.close();
if (pb_stm != null)
pb_stm.close();
}
}
}

Output

輸出量

pb_stm.markSupported(): false

翻譯自: https://www.includehelp.com/java/pushbackinputstream-marksupported-method-with-example.aspx

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/380151.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/380151.shtml
英文地址,請注明出處:http://en.pswp.cn/news/380151.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

面型對象 (接口與類的區別)

public class Demo4_Interface {public static void main(String[] args) {某女星 clown new 某女星();clown.潛規則();clown.關系();} }/*親爹只有一個,是單繼承;干爹可以有很多個,是多實現;*/ interface 某干爹{public void 關系();public void 潛規…

遠控免殺專題 13----zirikatu免殺

0x01 免殺能力一覽表 幾點說明: 1、上表中標識 √ 說明相應殺毒軟件未檢測出病毒,也就是代表了Bypass。 2、為了更好的對比效果,大部分測試payload均使用msf的windows/meterperter/reverse_tcp模塊生成。 3、由于本機測試時只是安裝了360全…

UML 的九種模型圖

1. UML的模型圖 UML 的模型圖能夠將被建模的系統的某一個方面的某一部分以圖形的方式表示出來,不同的視圖通過將多個不同的模型圖有機組合在一起就能夠描述系統模型的某方面的特征。UML的模型圖是有模型元素構成的,模型元素以圖標的形式直觀形象的表達…

【莫隊】區間眾數(Codeforces Round #716 (Div. 2) D)

D. Cut and Stick (賽后補題)借本題學習莫隊算法以及區間眾數的求法 題意:對于整型數組,每次詢問[L,R][L,R][L,R]區間問最少分為多少個子序列,使得每個子序列的眾數xxx的個數cntxcnt_xcntx?不大于 ?len2?\left \l…

如何正確使用SqlConnection

以前曾見過有人這樣寫代碼: public class Service1 : IService1{private SqlConnection conn new SqlConnection();public void Method1(){//do something with conn;}public void Method2(){//do something with conn;}public void Method3(){//do something with…

關系代數基本運算_關系代數的基本和附加運算

關系代數基本運算Definition 定義 Every DBMS must define a query language to enable users to access the data which is stored in the database. Relational Algebra is a procedural query language. It is used to query the database tables in order to access data…

遠控免殺專題 14 ---AVIator

0x01 免殺能力一覽表 幾點說明: 1、上表中標識 √ 說明相應殺毒軟件未檢測出病毒,也就是代表了Bypass。 2、為了更好的對比效果,大部分測試payload均使用msf的windows/meterperter/reverse_tcp模塊生成。 3、由于本機測試時只是安裝了360全…

面型對象 (包package)

面向對象(package關鍵字的概述及作用) 為什么要有包 將字節碼(.class)進行分類存放 包其實就是文件夾 代碼如下: package beyond.hjj;//在當前運行目錄下創建一個子目錄結構beyond\hjj,在子目錄下存放已經編譯成字節碼文件的clown.class類。 class c…

【Web開發】級聯查詢(Ajax/ jQuery/ Servlet)

實現級聯查詢 共有兩個下拉框&#xff0c;第一級為學院&#xff0c;第二級為學院開設的科目。 實現的功能為&#xff1a;當改變學院的選擇&#xff0c;第二級下拉框需變為對應學院開設的科目內容。 結果預覽&#xff1a; jsp頁面 <% page contentType"text/html;…

asp.net treeView綁定

這個東西不是什么復雜的東西&#xff0c; 幫著小兄弟寫個Demo, 實現個Binding public partial class _Default : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Bind(); } } priv…

關于TOmcat的一些小小的知識

web.xml中的url-pattern和form 表單中的action是相同的。form 表單中的action聲明的并不是servlet的名字 例&#xff1a; <servlet> <servlet-name>welcome</servlet-name> <servlet-class>WelcomeYou</servlet-class> </servlet> <ser…

Java文件類字符串getAbsolutePath()方法(帶示例)

文件類字符串getAbsolutePath() (File Class String getAbsolutePath()) This method is available in package java.io.File.getAbsolutePath(). 軟件包java.io.File.getAbsolutePath()中提供了此方法。 This method is used to return the absolute path of the file object …

遠控免殺專題(15)-DKMC免殺

0x01 免殺能力一覽表 幾點說明&#xff1a; 1、上表中標識 √ 說明相應殺毒軟件未檢測出病毒&#xff0c;也就是代表了Bypass。 2、為了更好的對比效果&#xff0c;大部分測試payload均使用msf的windows/meterperter/reverse_tcp模塊生成。 3、由于本機測試時只是安裝了360全…

面向對象(靜態成員內部類的調用)

class beyond{public static void main(String []args){//外部類名.內部類名 對象名 外部類名.內部類對象(new 內部類名)/*Outer.Inner yy Outer.new Inner(); 類里面有個非靜態方法&#xff0c;需要new創建Inner對象;正常的形式是這樣的&#xff0c;但是我們習慣將new放在前…

SQL——以面向集合的思維方式來思考

本文來自&#xff1a;http://www.ituring.com.cn/article/details/472 為了以有趣的方式更好地幫助你形成面向集合的思維方式&#xff0c;我將給出自己最喜歡的游戲之一——集合。你可以在線玩這個游戲&#xff0c;網址是www.setgame.com/puzzle/set.htm&#xff0c;每天都會貼…

轉載: 統計圖控件NetCharting 和ZedGraph的比較

原文出處&#xff1a;http://hi.baidu.com/goga/blog/item/07b3024f61b8cd35aec3ab47.html最近考察了幾個統計圖表控件包&#xff0c;開源的有ZedGraph&#xff0c;Nplot等&#xff0c;但是相比之下還是ZedGraph強大&#xff0c;方便一些&#xff0c;其他的感覺還是半成品。收費…

【匯編語言】狀態標志符(CF/OF/SF/ZF)在運算(ADD/SUB/ADC/SBB)過程中的響應變化

目錄各類運算時狀態標志的響應變化標志符在各種ADD運算下的響應情況標志符在各種SUB運算下的響應情況借助標志符實現多位數之間運算ADC(add with carry)帶進位加法指令SBB(subtract with borrow)帶借位減法指令各類運算時狀態標志的響應變化 標志符具體含義CF&#xff08;Carr…

Java集合unmodifiableSortedSet()方法(帶示例)

集合類unmodifiableSortedSet()方法 (Collections Class unmodifiableSortedSet() method) unmodifiableSortedSet() method is available in java.util package. unmodifiableSortedSet()方法在java.util包中可用。 unmodifiableSortedSet() method is used to get a non-modi…

遠控免殺專題(16)-Unicorn免殺

0x01 免殺能力一覽表 幾點說明&#xff1a; 1、上表中標識 √ 說明相應殺毒軟件未檢測出病毒&#xff0c;也就是代表了Bypass。 2、為了更好的對比效果&#xff0c;大部分測試payload均使用msf的windows/meterperter/reverse_tcp模塊生成。 3、由于本機測試時只是安裝了360全…

面向對象(匿名內部類在開發中的應用)

匿名內部類在開發中的應用 public class test1_NoNameInner {public static void main(String[] args) {PersonDemo yy new PersonDemo();//yy.method(new Student());yy.method(new Person() {public void show(){System.out.println("show");}});//匿名內部類當作…