// Stub class generated by rmic, do not edit.
// Contents subject to change without notice.
package com.healthmarketscience.rmiio;
import java.io.IOException;
import java.io.Serializable;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.UnexpectedException;
import javax.rmi.CORBA.Stub;
import javax.rmi.CORBA.Util;
import org.omg.CORBA.ORB;
import org.omg.CORBA.SystemException;
import org.omg.CORBA.portable.ApplicationException;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.RemarshalException;
import org.omg.CORBA.portable.ResponseHandler;
import org.omg.CORBA.portable.ServantObject;
public class _RemoteOutputStream_Stub extends Stub implements RemoteOutputStream {
private static final String[] _type_ids = {
"RMI:com.healthmarketscience.rmiio.RemoteOutputStream:0000000000000000"
};
public String[] _ids() {
return _type_ids;
}
public void flush() throws java.io.IOException, java.rmi.RemoteException {
if (!Util.isLocal(this)) {
try {
org.omg.CORBA_2_3.portable.InputStream in = null;
try {
OutputStream out = _request("flush", true);
_invoke(out);
} catch (ApplicationException ex) {
in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
String $_id = in.read_string();
if ($_id.equals("IDL:java/io/IOEx:1.0")) {
throw (java.io.IOException) in.read_value(java.io.IOException.class);
}
throw new UnexpectedException($_id);
} catch (RemarshalException ex) {
flush();
} finally {
_releaseReply(in);
}
} catch (SystemException ex) {
throw Util.mapSystemException(ex);
}
} else {
ServantObject so = _servant_preinvoke("flush",RemoteOutputStream.class);
if (so == null) {
flush();
return ;
}
try {
((RemoteOutputStream)so.servant).flush();
} catch (Throwable ex) {
Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
if (exCopy instanceof java.io.IOException) {
throw (java.io.IOException)exCopy;
}
throw Util.wrapException(exCopy);
} finally {
_servant_postinvoke(so);
}
}
}
public boolean usingGZIPCompression() throws java.io.IOException, java.rmi.RemoteException {
if (!Util.isLocal(this)) {
try {
org.omg.CORBA_2_3.portable.InputStream in = null;
try {
OutputStream out = _request("usingGZIPCompression", true);
in = (org.omg.CORBA_2_3.portable.InputStream)_invoke(out);
return in.read_boolean();
} catch (ApplicationException ex) {
in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
String $_id = in.read_string();
if ($_id.equals("IDL:java/io/IOEx:1.0")) {
throw (java.io.IOException) in.read_value(java.io.IOException.class);
}
throw new UnexpectedException($_id);
} catch (RemarshalException ex) {
return usingGZIPCompression();
} finally {
_releaseReply(in);
}
} catch (SystemException ex) {
throw Util.mapSystemException(ex);
}
} else {
ServantObject so = _servant_preinvoke("usingGZIPCompression",RemoteOutputStream.class);
if (so == null) {
return usingGZIPCompression();
}
try {
return ((RemoteOutputStream)so.servant).usingGZIPCompression();
} catch (Throwable ex) {
Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
if (exCopy instanceof java.io.IOException) {
throw (java.io.IOException)exCopy;
}
throw Util.wrapException(exCopy);
} finally {
_servant_postinvoke(so);
}
}
}
public void close(boolean arg0) throws java.io.IOException, java.rmi.RemoteException {
if (!Util.isLocal(this)) {
try {
org.omg.CORBA_2_3.portable.InputStream in = null;
try {
OutputStream out = _request("close", true);
out.write_boolean(arg0);
_invoke(out);
} catch (ApplicationException ex) {
in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
String $_id = in.read_string();
if ($_id.equals("IDL:java/io/IOEx:1.0")) {
throw (java.io.IOException) in.read_value(java.io.IOException.class);
}
throw new UnexpectedException($_id);
} catch (RemarshalException ex) {
close(arg0);
} finally {
_releaseReply(in);
}
} catch (SystemException ex) {
throw Util.mapSystemException(ex);
}
} else {
ServantObject so = _servant_preinvoke("close",RemoteOutputStream.class);
if (so == null) {
close(arg0);
return ;
}
try {
((RemoteOutputStream)so.servant).close(arg0);
} catch (Throwable ex) {
Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
if (exCopy instanceof java.io.IOException) {
throw (java.io.IOException)exCopy;
}
throw Util.wrapException(exCopy);
} finally {
_servant_postinvoke(so);
}
}
}
public void writePacket(byte[] arg0, int arg1) throws java.io.IOException, java.rmi.RemoteException {
if (!Util.isLocal(this)) {
try {
org.omg.CORBA_2_3.portable.InputStream in = null;
try {
org.omg.CORBA_2_3.portable.OutputStream out =
(org.omg.CORBA_2_3.portable.OutputStream)
_request("writePacket", true);
out.write_value(cast_array(arg0),byte[].class);
out.write_long(arg1);
_invoke(out);
} catch (ApplicationException ex) {
in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
String $_id = in.read_string();
if ($_id.equals("IDL:java/io/IOEx:1.0")) {
throw (java.io.IOException) in.read_value(java.io.IOException.class);
}
throw new UnexpectedException($_id);
} catch (RemarshalException ex) {
writePacket(arg0,arg1);
} finally {
_releaseReply(in);
}
} catch (SystemException ex) {
throw Util.mapSystemException(ex);
}
} else {
ServantObject so = _servant_preinvoke("writePacket",RemoteOutputStream.class);
if (so == null) {
writePacket(arg0, arg1);
return ;
}
try {
byte[] arg0Copy = (byte[]) Util.copyObject(arg0,_orb());
((RemoteOutputStream)so.servant).writePacket(arg0Copy, arg1);
} catch (Throwable ex) {
Throwable exCopy = (Throwable)Util.copyObject(ex,_orb());
if (exCopy instanceof java.io.IOException) {
throw (java.io.IOException)exCopy;
}
throw Util.wrapException(exCopy);
} finally {
_servant_postinvoke(so);
}
}
}
// This method is required as a work-around for
// a bug in the JDK 1.1.6 verifier.
private Serializable cast_array(Object obj) {
return (Serializable)obj;
}
}