com.google.android.exoplayer2.util.Util.isLinebreak()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(209)

本文整理了Java中com.google.android.exoplayer2.util.Util.isLinebreak()方法的一些代码示例,展示了Util.isLinebreak()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.isLinebreak()方法的具体详情如下:
包路径:com.google.android.exoplayer2.util.Util
类名称:Util
方法名:isLinebreak

Util.isLinebreak介绍

[英]Returns whether the given character is a carriage return ('\r') or a line feed ('\n').
[中]返回给定字符是回车符('\r')还是换行符('\n')。

代码示例

代码示例来源:origin: google/ExoPlayer

  1. private static int skipIgnorableWhitespace(BufferedReader reader, boolean skipLinebreaks, int c)
  2. throws IOException {
  3. while (c != -1 && Character.isWhitespace(c) && (skipLinebreaks || !Util.isLinebreak(c))) {
  4. c = reader.read();
  5. }
  6. return c;
  7. }

代码示例来源:origin: google/ExoPlayer

  1. private static boolean checkPlaylistHeader(BufferedReader reader) throws IOException {
  2. int last = reader.read();
  3. if (last == 0xEF) {
  4. if (reader.read() != 0xBB || reader.read() != 0xBF) {
  5. return false;
  6. }
  7. // The playlist contains a Byte Order Mark, which gets discarded.
  8. last = reader.read();
  9. }
  10. last = skipIgnorableWhitespace(reader, true, last);
  11. int playlistHeaderLength = PLAYLIST_HEADER.length();
  12. for (int i = 0; i < playlistHeaderLength; i++) {
  13. if (last != PLAYLIST_HEADER.charAt(i)) {
  14. return false;
  15. }
  16. last = reader.read();
  17. }
  18. last = skipIgnorableWhitespace(reader, false, last);
  19. return Util.isLinebreak(last);
  20. }

代码示例来源:origin: google/ExoPlayer

  1. while (lineLimit < limit && !Util.isLinebreak(data[lineLimit])) {
  2. lineLimit++;

相关文章