java.io.OptionalDataException.printStackTrace()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(111)

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

OptionalDataException.printStackTrace介绍

暂无

代码示例

代码示例来源:origin: org.drools/drools-compiler

@Test
public void testJBRULES_1946() {
  KieBase kbase = loadKnowledgeBase("../Sample.drl" );
  try {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream( baos );
    oos.writeObject( kbase );
    oos.flush();
    oos.close();
    baos.flush();
    baos.close();
    byte[] serializedKb = baos.toByteArray();
    ByteArrayInputStream bais = new ByteArrayInputStream( serializedKb );
    ObjectInputStream ois = new ObjectInputStream( bais );
    KieBase kb2 = (KieBase) ois.readObject();
  } catch ( OptionalDataException ode ) {
    ode.printStackTrace();
    fail( "EOF? " + ode.eof );
  } catch ( Exception e ) {
    e.printStackTrace();
    fail( "Unexpected exception: " + e.getMessage() );
  }
}

代码示例来源:origin: org.drools/drools-compiler

@Test
public void testJBRULES_1946_2() {
  KieBase kbase = loadKnowledgeBase("../Sample.drl" );
  try {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DroolsObjectOutputStream oos = new DroolsObjectOutputStream( baos );
    oos.writeObject( kbase );
    oos.flush();
    oos.close();
    baos.flush();
    baos.close();
    byte[] serializedKb = baos.toByteArray();
    ByteArrayInputStream bais = new ByteArrayInputStream( serializedKb );
    DroolsObjectInputStream ois = new DroolsObjectInputStream( bais );
    KieBase kb2 = (KieBase) ois.readObject();
  } catch ( OptionalDataException ode ) {
    ode.printStackTrace();
    fail( "EOF? " + ode.eof );
  } catch ( Exception e ) {
    e.printStackTrace();
    fail( "Unexpected exception: " + e.getMessage() );
  }
}

代码示例来源:origin: devinhu/androidone

e.printStackTrace();
} catch (OptionalDataException e) {
  e.printStackTrace();
} catch (FileNotFoundException e) {
  e.printStackTrace();

代码示例来源:origin: org.drools/drools-reteoo

@Test
public void testJBRULES_1946() {
  KnowledgeBase kbase = loadKnowledgeBase("../Sample.drl" );
  try {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream( baos );
    oos.writeObject( kbase );
    oos.flush();
    oos.close();
    baos.flush();
    baos.close();
    byte[] serializedKb = baos.toByteArray();
    ByteArrayInputStream bais = new ByteArrayInputStream( serializedKb );
    ObjectInputStream ois = new ObjectInputStream( bais );
    KnowledgeBase kb2 = (KnowledgeBase) ois.readObject();
  } catch ( OptionalDataException ode ) {
    ode.printStackTrace();
    fail( "EOF? " + ode.eof );
  } catch ( Exception e ) {
    e.printStackTrace();
    fail( "Unexpected exception: " + e.getMessage() );
  }
}

代码示例来源:origin: JChemPaint/jchempaint

public void redo() throws CannotRedoException {
  this.atom.setSymbol(symbol);
  try {
    IsotopeFactory ifac = XMLIsotopeFactory.getInstance(atom.getBuilder());
    this.atom.setMassNumber(ifac.getMajorIsotope(symbol).getMassNumber());
    chemModelRelay.updateAtom(atom);
    ifac.configure(atom);
  } catch (OptionalDataException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
}

代码示例来源:origin: JChemPaint/jchempaint

public void undo() throws CannotUndoException {
  this.atom.setSymbol(formerSymbol);
  try {
    IsotopeFactory ifac = XMLIsotopeFactory.getInstance(atom.getBuilder());
    this.atom.setMassNumber(ifac.getMajorIsotope(formerSymbol).getMassNumber());
    chemModelRelay.updateAtom(atom);
    ifac.configure(atom);
  } catch (OptionalDataException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
}

代码示例来源:origin: org.drools/drools-reteoo

@Test
public void testJBRULES_1946_2() {
  KnowledgeBase kbase = loadKnowledgeBase("../Sample.drl" );
  try {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DroolsObjectOutputStream oos = new DroolsObjectOutputStream( baos );
    oos.writeObject( kbase );
    oos.flush();
    oos.close();
    baos.flush();
    baos.close();
    byte[] serializedKb = baos.toByteArray();
    ByteArrayInputStream bais = new ByteArrayInputStream( serializedKb );
    DroolsObjectInputStream ois = new DroolsObjectInputStream( bais );
    KnowledgeBase kb2 = (KnowledgeBase) ois.readObject();
  } catch ( OptionalDataException ode ) {
    ode.printStackTrace();
    fail( "EOF? " + ode.eof );
  } catch ( Exception e ) {
    e.printStackTrace();
    fail( "Unexpected exception: " + e.getMessage() );
  }
}

相关文章