本文整理汇总了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);
}
示例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);
}
示例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;
}