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


Java BufferOverflowException.initCause方法代码示例

本文整理汇总了Java中java.nio.BufferOverflowException.initCause方法的典型用法代码示例。如果您正苦于以下问题:Java BufferOverflowException.initCause方法的具体用法?Java BufferOverflowException.initCause怎么用?Java BufferOverflowException.initCause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.nio.BufferOverflowException的用法示例。


在下文中一共展示了BufferOverflowException.initCause方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: encode

import java.nio.BufferOverflowException; //导入方法依赖的package包/类
private static void encode(CharSequence paramCharSequence, ByteBuffer paramByteBuffer)
{
  if (paramByteBuffer.isReadOnly()) {
    throw new ReadOnlyBufferException();
  }
  if (paramByteBuffer.hasArray()) {
    try
    {
      paramByteBuffer.position(encode(paramCharSequence, paramByteBuffer.array(), paramByteBuffer.arrayOffset() + paramByteBuffer.position(), paramByteBuffer.remaining()) - paramByteBuffer.arrayOffset());
      return;
    }
    catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException)
    {
      BufferOverflowException localBufferOverflowException = new BufferOverflowException();
      localBufferOverflowException.initCause(localArrayIndexOutOfBoundsException);
      throw localBufferOverflowException;
    }
  }
  encodeDirect(paramCharSequence, paramByteBuffer);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:21,代码来源:CodedOutputByteBufferNano.java

示例2: zza

import java.nio.BufferOverflowException; //导入方法依赖的package包/类
private static void zza(CharSequence paramCharSequence, ByteBuffer paramByteBuffer)
{
  if (paramByteBuffer.isReadOnly()) {
    throw new ReadOnlyBufferException();
  }
  if (paramByteBuffer.hasArray()) {
    try
    {
      paramByteBuffer.position(zza(paramCharSequence, paramByteBuffer.array(), paramByteBuffer.arrayOffset() + paramByteBuffer.position(), paramByteBuffer.remaining()) - paramByteBuffer.arrayOffset());
      return;
    }
    catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException)
    {
      BufferOverflowException localBufferOverflowException = new BufferOverflowException();
      localBufferOverflowException.initCause(localArrayIndexOutOfBoundsException);
      throw localBufferOverflowException;
    }
  }
  zzb(paramCharSequence, paramByteBuffer);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:21,代码来源:zzaic.java

示例3: a

import java.nio.BufferOverflowException; //导入方法依赖的package包/类
private static void a(CharSequence paramCharSequence, ByteBuffer paramByteBuffer)
{
  if (paramByteBuffer.isReadOnly()) {
    throw new ReadOnlyBufferException();
  }
  if (paramByteBuffer.hasArray()) {
    try
    {
      paramByteBuffer.position(a(paramCharSequence, paramByteBuffer.array(), paramByteBuffer.arrayOffset() + paramByteBuffer.position(), paramByteBuffer.remaining()) - paramByteBuffer.arrayOffset());
      return;
    }
    catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException)
    {
      BufferOverflowException localBufferOverflowException = new BufferOverflowException();
      localBufferOverflowException.initCause(localArrayIndexOutOfBoundsException);
      throw localBufferOverflowException;
    }
  }
  b(paramCharSequence, paramByteBuffer);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:21,代码来源:qal.java

示例4: encode

import java.nio.BufferOverflowException; //导入方法依赖的package包/类
/**
 * Encodes {@code sequence} into UTF-8, in {@code byteBuffer}. For a string, this method is
 * equivalent to {@code buffer.put(string.getBytes(UTF_8))}, but is more efficient in both time
 * and space. Bytes are written starting at the current position. This method requires paired
 * surrogates, and therefore does not support chunking.
 *
 * <p>To ensure sufficient space in the output buffer, either call {@link #encodedLength} to
 * compute the exact amount needed, or leave room for {@code 3 * sequence.length()}, which is the
 * largest possible number of bytes that any input can be encoded to.
 *
 * @throws IllegalArgumentException if {@code sequence} contains ill-formed UTF-16 (unpaired
 *     surrogates)
 * @throws BufferOverflowException if {@code sequence} encoded in UTF-8 does not fit in
 *     {@code byteBuffer}'s remaining space.
 * @throws ReadOnlyBufferException if {@code byteBuffer} is a read-only buffer.
 */
private static void encode(CharSequence sequence, ByteBuffer byteBuffer) {
  if (byteBuffer.isReadOnly()) {
    throw new ReadOnlyBufferException();
  } else if (byteBuffer.hasArray()) {
    try {
      int encoded = encode(sequence,
              byteBuffer.array(),
              byteBuffer.arrayOffset() + byteBuffer.position(),
              byteBuffer.remaining());
      byteBuffer.position(encoded - byteBuffer.arrayOffset());
    } catch (ArrayIndexOutOfBoundsException e) {
      BufferOverflowException boe = new BufferOverflowException();
      boe.initCause(e);
      throw boe;
    }
  } else {
    encodeDirect(sequence, byteBuffer);
  }
}
 
开发者ID:IvanVolosyuk,项目名称:diskusage,代码行数:36,代码来源:CodedOutputByteBufferNano.java


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