当前位置: 首页>>代码示例>>Java>>正文


Java EOFException类代码示例

本文整理汇总了Java中org.kohsuke.rngom.parse.compact.EOFException的典型用法代码示例。如果您正苦于以下问题:Java EOFException类的具体用法?Java EOFException怎么用?Java EOFException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EOFException类属于org.kohsuke.rngom.parse.compact包,在下文中一共展示了EOFException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readChar

import org.kohsuke.rngom.parse.compact.EOFException; //导入依赖的package包/类
public char readChar() throws EOFException
{
   if (inBuf > 0)
   {
      --inBuf;

      if (++bufpos == bufsize)
         bufpos = 0;

      return buffer[bufpos];
   }

   if (++bufpos >= maxNextCharInd)
      FillBuff();

   char c = buffer[bufpos];

   UpdateLineColumn(c);
   return (c);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:SimpleCharStream.java

示例2: readChar

import org.kohsuke.rngom.parse.compact.EOFException; //导入依赖的package包/类
public char readChar() throws EOFException
{
	if(inBuf > 0)
	{
		--inBuf;

		if(++bufpos == bufsize)
		{
			bufpos = 0;
		}

		return buffer[bufpos];
	}

	if(++bufpos >= maxNextCharInd)
	{
		FillBuff();
	}

	char c = buffer[bufpos];

	UpdateLineColumn(c);
	return (c);
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:25,代码来源:SimpleCharStream.java

示例3: BeginToken

import org.kohsuke.rngom.parse.compact.EOFException; //导入依赖的package包/类
public char BeginToken() throws EOFException
{
   tokenBegin = -1;
   char c = readChar();
   tokenBegin = bufpos;

   return c;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SimpleCharStream.java

示例4: BeginToken

import org.kohsuke.rngom.parse.compact.EOFException; //导入依赖的package包/类
public char BeginToken() throws EOFException
{
	tokenBegin = -1;
	char c = readChar();
	tokenBegin = bufpos;

	return c;
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:9,代码来源:SimpleCharStream.java

示例5: FillBuff

import org.kohsuke.rngom.parse.compact.EOFException; //导入依赖的package包/类
protected void FillBuff() throws EOFException
{
   if (maxNextCharInd == available)
   {
      if (available == bufsize)
      {
         if (tokenBegin > 2048)
         {
            bufpos = maxNextCharInd = 0;
            available = tokenBegin;
         }
         else if (tokenBegin < 0)
            bufpos = maxNextCharInd = 0;
         else
            ExpandBuff(false);
      }
      else if (available > tokenBegin)
         available = bufsize;
      else if ((tokenBegin - available) < 2048)
         ExpandBuff(true);
      else
         available = tokenBegin;
   }

   int i;
   try {
      if ((i = inputStream.read(buffer, maxNextCharInd,
                                  available - maxNextCharInd)) == -1)
      {
         inputStream.close();
         throw new java.io.IOException();
      }
      else
         maxNextCharInd += i;
      return;
   }
   catch(java.io.IOException e) {
      --bufpos;
      backup(0);
      if (tokenBegin == -1)
         tokenBegin = bufpos;
      throw new EOFException();
   }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:45,代码来源:SimpleCharStream.java

示例6: FillBuff

import org.kohsuke.rngom.parse.compact.EOFException; //导入依赖的package包/类
protected void FillBuff() throws EOFException
{
	if(maxNextCharInd == available)
	{
		if(available == bufsize)
		{
			if(tokenBegin > 2048)
			{
				bufpos = maxNextCharInd = 0;
				available = tokenBegin;
			}
			else if(tokenBegin < 0)
			{
				bufpos = maxNextCharInd = 0;
			}
			else
			{
				ExpandBuff(false);
			}
		}
		else if(available > tokenBegin)
		{
			available = bufsize;
		}
		else if((tokenBegin - available) < 2048)
		{
			ExpandBuff(true);
		}
		else
		{
			available = tokenBegin;
		}
	}

	int i;
	try
	{
		if((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1)
		{
			inputStream.close();
			throw new java.io.IOException();
		}
		else
		{
			maxNextCharInd += i;
		}
		return;
	}
	catch(java.io.IOException e)
	{
		--bufpos;
		backup(0);
		if(tokenBegin == -1)
		{
			tokenBegin = bufpos;
		}
		throw new EOFException();
	}
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:60,代码来源:SimpleCharStream.java


注:本文中的org.kohsuke.rngom.parse.compact.EOFException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。