本文整理匯總了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();
}