github.com/c-darwin/mobile@v0.0.0-20160313183840-ff625c46f7c9/bind/testdata/basictypes.java.golden (about)

     1  // Java Package basictypes is a proxy for talking to a Go program.
     2  //   gobind -lang=java basictypes
     3  //
     4  // File is generated by gobind. Do not edit.
     5  package go.basictypes;
     6  
     7  import go.Seq;
     8  
     9  public abstract class Basictypes {
    10      private Basictypes() {} // uninstantiable
    11      
    12      public static boolean Bool(boolean p0) {
    13          go.Seq _in = new go.Seq();
    14          go.Seq _out = new go.Seq();
    15          boolean _result;
    16          _in.writeBool(p0);
    17          Seq.send(DESCRIPTOR, CALL_Bool, _in, _out);
    18          _result = _out.readBool();
    19          return _result;
    20      }
    21      
    22      public static byte[] ByteArrays(byte[] x) {
    23          go.Seq _in = new go.Seq();
    24          go.Seq _out = new go.Seq();
    25          byte[] _result;
    26          _in.writeByteArray(x);
    27          Seq.send(DESCRIPTOR, CALL_ByteArrays, _in, _out);
    28          _result = _out.readByteArray();
    29          return _result;
    30      }
    31      
    32      public static void Error() throws Exception {
    33          go.Seq _in = new go.Seq();
    34          go.Seq _out = new go.Seq();
    35          Seq.send(DESCRIPTOR, CALL_Error, _in, _out);
    36          String _err = _out.readString();
    37          if (_err != null) {
    38              throw new Exception(_err);
    39          }
    40      }
    41      
    42      public static long ErrorPair() throws Exception {
    43          go.Seq _in = new go.Seq();
    44          go.Seq _out = new go.Seq();
    45          long _result;
    46          Seq.send(DESCRIPTOR, CALL_ErrorPair, _in, _out);
    47          _result = _out.readInt();
    48          String _err = _out.readString();
    49          if (_err != null) {
    50              throw new Exception(_err);
    51          }
    52          return _result;
    53      }
    54      
    55      public static void Ints(byte x, short y, int z, long t, long u) {
    56          go.Seq _in = new go.Seq();
    57          go.Seq _out = new go.Seq();
    58          _in.writeInt8(x);
    59          _in.writeInt16(y);
    60          _in.writeInt32(z);
    61          _in.writeInt64(t);
    62          _in.writeInt(u);
    63          Seq.send(DESCRIPTOR, CALL_Ints, _in, _out);
    64      }
    65      
    66      private static final int CALL_Bool = 1;
    67      private static final int CALL_ByteArrays = 2;
    68      private static final int CALL_Error = 3;
    69      private static final int CALL_ErrorPair = 4;
    70      private static final int CALL_Ints = 5;
    71      private static final String DESCRIPTOR = "basictypes";
    72  }