本文整理汇总了Java中java.nio.channels.ClosedChannelException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java ClosedChannelException.printStackTrace方法的具体用法?Java ClosedChannelException.printStackTrace怎么用?Java ClosedChannelException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.nio.channels.ClosedChannelException
的用法示例。
在下文中一共展示了ClosedChannelException.printStackTrace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: position
import java.nio.channels.ClosedChannelException; //导入方法依赖的package包/类
/**
* set position in events from start of file
*
* @param event the number of the event, starting with 0
*/
@Override
synchronized public void position(long event) {
// if(event==size()) event=event-1;
int newChunkNumber;
try {
if ((newChunkNumber = getChunkNumber(event)) != chunkNumber) {
mapChunk(newChunkNumber);
}
byteBuffer.position((int) ((event * eventSizeBytes) % chunkSizeBytes));
position = event;
} catch (ClosedByInterruptException e3) {
log.info("caught interrupt, probably from single stepping this file");
} catch (ClosedChannelException cce) {
log.warning("caught exception " + cce);
cce.printStackTrace();
} catch (IOException e) {
log.warning("caught exception " + e);
e.printStackTrace();
} catch (IllegalArgumentException e2) {
log.warning("caught " + e2);
e2.printStackTrace();
}
}
示例2: unlockSession
import java.nio.channels.ClosedChannelException; //导入方法依赖的package包/类
private void unlockSession() throws IOException {
try {
lock.release();
} catch (ClosedChannelException e) {
e.printStackTrace();
}
oLock.close();
fLock.delete();
}