stringreader_Java StringReader markSupported()方法與示例

stringreader

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

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

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

  • markSupported() method is used to check whether this StringReader stream support mark() method or not.

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

  • 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 supports mark() method otherwise it returns false.

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

Example:

例:

// Java program to demonstrate the example 
// of boolean markSupported() method of StringReader
import java.io.*;
public class MarkSupportedOfSR {
public static void main(String[] args) throws Exception {
StringReader str_r = null;
try {
// Instantiates StringReader
str_r = new StringReader("JavaWorld!");
// By using markSupported() method is to check 
// whether this stream str_r supports mark()
// method or not
boolean status = str_r.markSupported();
System.out.println("str_r.markSupported(): " + status);
} catch (Exception ex) {
System.out.println(ex.toString());
} finally {
// with the help of this block is to
// free all necessary resources linked
// with the stream
if (str_r != null) {
str_r.close();
}
}
}
}

Output

輸出量

str_r.markSupported(): true

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

stringreader

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

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

相關文章

pacemaker+corosync實現集群管理

前言: 高可用集群,是指以減少服務中斷(如因服務器宕機等引起的服務中斷)時間為目的的服務器集群技術。簡單的說,集群就是一組計算機,它們作為一個整體向用戶提供一組網絡資源。這些單個的計算機系統就是集群的節點。 …

分頁導航的實現方法

這個導航是閱讀了精通css這本書后做的demo&#xff0c;感覺以前寫的真的是弱爆了 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><title>Document</title><style type"text/css">ol.n…

更換mysql_這些被你忽視的MySQL細節,可能會讓你丟飯碗!

我們在 MySQL 入門篇主要介紹了基本的 SQL 命令、數據類型和函數&#xff0c;在具備以上知識后&#xff0c;你就可以進行 MySQL 的開發工作了&#xff0c;但是如果要成為一個合格的開發人員&#xff0c;你還要具備一些更高級的技能&#xff0c;下面我們就來探討一下 MySQL 都需…

Java RandomAccessFile skipBytes()方法與示例

RandomAccessFile類skipBytes()方法 (RandomAccessFile Class skipBytes() method) skipBytes() method is available in java.io package. skipBytes()方法在java.io包中可用。 skipBytes() method is used to skip the given number of bytes in this file and possibly set …

rhcs集群套件—紅帽6的高可用

含義及理解&#xff1a; RHCS是Red Hat Cluster Suite的縮寫&#xff0c;也就是紅帽子集群套件&#xff0c;RHCS是一個能夠提供高可用性、高可靠性、負載均衡、存儲共享且經濟廉價的集群工具集合&#xff0c;&#xff0c;它將集群系統中三大集群架構&#xff08;高可用性集群、…

MapReduce二次排序

2019獨角獸企業重金招聘Python工程師標準>>> 默認情況下&#xff0c;Map輸出的結果會對Key進行默認的排序&#xff0c;但是有時候需要對Key排序的同時還需要對Value進行排序&#xff0c;這時候就要用到二次排序了。下面我們來說說二次排序 1、二次排序原理 我們把二…

數據有序_詳解數據庫插入性能優化:合并+事務+有序數據進行INSERT操作

概述對于一些數據量較大的系統&#xff0c;數據庫面臨的問題除了查詢效率低下&#xff0c;還有就是數據入庫時間長。特別像報表系統&#xff0c;每天花費在數據導入上的時間可能會長達幾個小時或十幾個小時之久。因此&#xff0c;優化數據庫插入性能是很有意義的。其實最有效的…

Java ProcessBuilder environment()方法與示例

ProcessBuilder類的environment()方法 (ProcessBuilder Class environment() method) environment() method is available in java.lang package. environment()方法在java.lang包中可用。 environment() method is used to return Map interfaces of this process builder env…

容器內應用日志收集方案

容器化應用日志收集挑戰 應用日志的收集、分析和監控是日常運維工作重要的部分&#xff0c;妥善地處理應用日志收集往往是應用容器化重要的一個課題。 Docker處理日志的方法是通過docker engine捕捉每一個容器進程的STDOUT和STDERR&#xff0c;通過為contrainer制定不同log dri…

python統計行號_利用Python進行數據分析(第三篇上)

上一篇文章我記錄了自己在入門 Python 學習的一些基礎內容以及實際操作代碼時所碰到的一些問題。這篇我將會記錄我在學習和運用 Python 進行數據分析的過程&#xff1a;介紹 Numpy 和 Pandas 兩個包運用 Numpy 和 Pandas 分析一維、二維數據數據分析的基本過程實戰項目【用 Pyt…

lnmp架構搭建—源碼編譯(nginx、mysql、php)

含義及理解&#xff1a; LNMP LinuxNginxMysqlPHP&#xff1a;LNMP是指一組通常一起使用來運行動態網站或者服務器的自由軟件名稱首字母縮寫。L指Linux&#xff0c;N指Nginx&#xff0c;M一般指MySQL&#xff0c;也可以指MariaDB&#xff0c;P一般指PHP&#xff0c;也可以指P…

Java PipedInputStream available()方法與示例

PipedInputStream類的available()方法 (PipedInputStream Class available() method) available() method is available in java.io package. available()方法在java.io包中可用。 available() method is used to return the number of available bytes left that can be read …

解析xml_Mybatis中mapper的xml解析詳解

上一篇文章分析了mapper注解關鍵類MapperAnnotationBuilder&#xff0c;今天來看mapper的項目了解析關鍵類XMLMapperBuilder。基礎介紹回顧下之前是在分析configuration的初始化過程&#xff0c;已經進行到了最后一步mapperElement(root.evalNode("mappers"))&#x…

lnmp—MemCache的作用

含義及理解&#xff1a; 1 . memcache是一個高性能的分布式的內存對象緩存系統&#xff0c;用于動態web應用以減輕數據庫負擔。通過在內存里維護一個統一的巨大的hash表&#xff0c;來存儲經常被讀寫的一些數組與文件&#xff0c;從而極大的提高網站的運行效率。 memcache是一…

Java ListResourceBundle getKeys()方法與示例

ListResourceBundle類的getContents()方法 (ListResourceBundle Class getContents() method) getContents() method is available in java.util package. getContents()方法在java.util包中可用。 getContents() method is used to return an enumeration of all the keys tha…

orale用戶密碼過期處理

使用具有管理權限的用戶登錄1、查看用戶的proifle是哪個&#xff0c;一般是default&#xff1a;SELECT username,PROFILE FROM dba_users;2、查看指定概要文件&#xff08;如default&#xff09;的密碼有效期設置&#xff1a;sql>SELECT * FROM dba_profiles s WHERE s.prof…

python字典怎么設置_在python中設置字典中的屬性

在python中設置字典中的屬性是否可以在python中從字典創建一個對象&#xff0c;使每個鍵都是該對象的屬性&#xff1f;像這樣的東西&#xff1a;d { name: Oscar, lastName: Reyes, age:32 }e Employee(d)print e.name # Oscarprint e.age 10 # 42我認為這幾乎與這個問題相反…

Java ObjectInputStream readByte()方法與示例

ObjectInputStream類readByte()方法 (ObjectInputStream Class readByte() method) readByte() method is available in java.io package. readByte()方法在java.io包中可用。 readByte() method is used to read a byte (i.e. 8 bit) of data from this ObjectInputStream. re…

openresty—實現緩存前移

含義及理解&#xff1a; OpenResty(又稱&#xff1a;ngx_openresty) 是一個基于 NGINX 的可伸縮的 Web 平臺&#xff0c;由中國人章亦春發起&#xff0c;提供了很多高質量的第三方模塊。 其目標是讓Web服務直接跑在Nginx服務內部&#xff0c;充分利用Nginx的非阻塞I/O模型&am…

Nginx+Keepalived+Tomcat之動靜分離的web集群

NginxKeepalivedTomcat之動靜分離的web集群 博客分類&#xff1a; webserverNginxKeepalivedTomcat之動靜分離的web集群為小公司提供大概一天持續在100萬/日之間訪問的高性能、高可用、高并發訪問及動靜分離的web集群方案NginxKeepalived 高可用、反向代理NginxPHP …