云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > Java语言编程规范.

Java语言编程规范.

  • 62 次阅读
  • 3 次下载
  • 2026/4/27 2:51:35

Java语言编程规范for ETS Version: <1.0> Date: <2003/3/13> 中经互联网络有限公司 /**

* Skip characters. *

* @param n The number of characters to skip *

* @return The number of characters actually skipped *

* @exception IOException If an I/O error occurs */

public long skip(long n) throws IOException { if (n < 0L) { throw new IllegalArgumentException(\ } synchronized (lock) { ensureOpen(); long r = n; while (r > 0) { if (nextChar >= nChars) fill(); if (nextChar >= nChars) /* EOF */ break; long d = nChars - nextChar; if (r <= d) { nextChar += r; r = 0; break; } else { r -= d; nextChar = nChars; } } return n - r; } }

/**

* Tell whether this stream is ready to be read. A buffered character * stream is ready if the buffer is not empty, or if the underlying * character stream is ready. *

* @exception IOException If an I/O error occurs */

public boolean ready() throws IOException { synchronized (lock) { ensureOpen(); return (nextChar < nChars) || in.ready(); } Confidential ?中经互联网络有限公司

Page 29 of 31

Java语言编程规范for ETS Version: <1.0> Date: <2003/3/13> 中经互联网络有限公司 }

/**

* Tell whether this stream supports the mark() operation, which it does. */

public boolean markSupported() { return true; }

/**

* Mark the present position in the stream. Subsequent calls to reset() * will attempt to reposition the stream to this point. *

* @param readAheadLimit Limit on the number of characters that may be * read while still preserving the mark. After * reading this many characters, attempting to

* reset the stream may fail. A limit value larger * than the size of the input buffer will cause a * new buffer to be allocated whose size is no * smaller than limit. Therefore large values * should be used with care. *

* @exception IllegalArgumentException If readAheadLimit is < 0 * @exception IOException If an I/O error occurs */

public void mark(int readAheadLimit) throws IOException { if (readAheadLimit < 0) { throw new IllegalArgumentException(\ } synchronized (lock) { ensureOpen(); this.readAheadLimit = readAheadLimit; markedChar = nextChar; } }

/**

* Reset the stream to the most recent mark. *

* @exception IOException If the stream has never been marked, * or if the mark has been invalidated */

public void reset() throws IOException { synchronized (lock) { ensureOpen(); if (markedChar < 0) throw new IOException((markedChar == INVALIDATED) ? \Confidential ?中经互联网络有限公司

Page 30 of 31

Java语言编程规范for ETS 中经互联网络有限公司 : \ nextChar = markedChar; } }

/**

* Close the stream. *

* @exception IOException If an I/O error occurs */

public void close() throws IOException { synchronized (lock) { if (in == null) return; in.close(); in = null; cb = null; } } }

Confidential ?中经互联网络有限公司

Version: <1.0> Date: <2003/3/13> Page 31 of 31

搜索更多关于: Java语言编程规范. 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

Java语言编程规范for ETS Version: Date: 中经互联网络有限公司 /** * Skip characters. * * @param n The number of characters to skip * * @return The number of characters actually skipped * * @exception IOException If an I/O error occurs */ public long skip(long n) throws IOExceptio

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com