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


Java BinaryResourceImpl.EObjectInputStream方法代码示例

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


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

示例1: readContents

import org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl; //导入方法依赖的package包/类
protected void readContents(final StorageAwareResource resource, final InputStream inputStream) throws IOException {
  Map<Object, Object> _emptyMap = CollectionLiterals.<Object, Object>emptyMap();
  final BinaryResourceImpl.EObjectInputStream in = new BinaryResourceImpl.EObjectInputStream(inputStream, _emptyMap) {
    @Override
    public int readCompressedInt() throws IOException {
      int _xblockexpression = (int) 0;
      {
        this.resourceSet = null;
        _xblockexpression = super.readCompressedInt();
      }
      return _xblockexpression;
    }
    
    @Override
    public InternalEObject loadEObject() throws IOException {
      final InternalEObject result = super.loadEObject();
      ResourceStorageLoadable.this.handleLoadEObject(result, this);
      return result;
    }
  };
  in.loadResource(resource);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:23,代码来源:ResourceStorageLoadable.java

示例2: testDeserializeAsLowerCase

import org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl; //导入方法依赖的package包/类
@Test public void testDeserializeAsLowerCase() throws IOException {
	QualifiedName upperCase = QualifiedName.create("A", "B");
	QualifiedName lowerCase = upperCase.toLowerCase();
	
	ByteArrayOutputStream bos = new ByteArrayOutputStream();
	EObjectOutputStream out = new BinaryResourceImpl.EObjectOutputStream(bos, Collections.emptyMap());
	upperCase.writeToStream(out);
	lowerCase.writeToStream(out);
	out.flush();
	
	EObjectInputStream in = new BinaryResourceImpl.EObjectInputStream(new ByteArrayInputStream(bos.toByteArray()), Collections.emptyMap());
	QualifiedName readUpperCase = QualifiedName.createFromStream(in);
	QualifiedName readLowerCase = QualifiedName.createFromStream(in);
	assertEquals(QualifiedName.class.getName(), readUpperCase.getClass().getName());
	assertEquals(QualifiedName.class.getName() + "$QualifiedNameLowerCase", readLowerCase.getClass().getName());
	assertEquals(upperCase, readUpperCase);
	assertEquals(lowerCase, readLowerCase);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:19,代码来源:QualifiedNameTest.java

示例3: handleLoadEObject

import org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl; //导入方法依赖的package包/类
protected Object handleLoadEObject(final InternalEObject loaded, final BinaryResourceImpl.EObjectInputStream input) throws IOException {
  return null;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:ResourceStorageLoadable.java


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