Package com.maverick.util

Examples of com.maverick.util.ByteArrayWriter.toByteArray()


                writer.writeUINT64(((Date) value).getTime());
            } else {
                writer.writeString(value.toString());
            }
        }
        requestData = writer.toByteArray();
    }

    public String getRequestName() {
        return requestName;
    }
View Full Code Here


     */
    public byte[] create() throws IOException {
        ByteArrayWriter baw = new ByteArrayWriter();
        baw.writeBoolean(initiator);
        baw.writeString(id);
        return baw.toByteArray();
    }

    /*
     * (non-Javadoc)
     *
 
View Full Code Here

  public byte[] create() throws IOException {
    ByteArrayWriter msg = new ByteArrayWriter();
    msg.writeString(hostname);
    msg.writeInt(port);
   
    return msg.toByteArray();
  }

  public void onChannelClose() {
    if(input!=null)
      input.close();
View Full Code Here

  public byte[] create() throws IOException {

    ByteArrayWriter msg = new ByteArrayWriter();
    msg.writeString(hostname);
    msg.writeInt(port);
    return msg.toByteArray();
  }

  public void onChannelOpen(byte[] data) {

    try {
View Full Code Here

        msg.writeString(tunnel.getTransport());
        msg.writeString(tunnel.getSourceInterface());       
        msg.writeInt(tunnel.getSourcePort());
        msg.writeInt(tunnel.getDestination().getPort());
        msg.writeString(destHost);
        Request req = new Request(START_LOCAL_TUNNEL, msg.toByteArray());
        return req;

    }

    void stopLocalTunnels(MultiplexedConnection agent, Collection<Tunnel> tunnels) throws CoreException {
View Full Code Here

        for (Tunnel tunnel : tunnels) {
            try {
                ByteArrayWriter msg = new ByteArrayWriter();
                msg.writeInt(tunnel.getResourceId());
                if (!agent.sendRequest(new Request(STOP_LOCAL_TUNNEL, msg.toByteArray()), false) && e == null) {
                    e = new TunnelException(TunnelException.AGENT_REFUSED_LOCAL_TUNNEL_STOP, (Throwable)null);
                }
            } catch (IOException ex) {
                throw new TunnelException(TunnelException.INTERNAL_ERROR, ex);
            }
View Full Code Here

    try {
      ByteArrayWriter msg = new ByteArrayWriter();
      msg.writeString(url.toExternalForm());
      msg.writeString(launchSession.getId());
      Request request = new Request("openURL", msg.toByteArray());
      if (agent.sendRequest(request, true)) {
        if(request.getRequestData()!=null) {
        ByteArrayReader rdr = new ByteArrayReader(request.getRequestData());
        return (int) rdr.readInt();
        }
View Full Code Here

        msg.writeString(tunnel.getSourceInterface());
        msg.writeInt(tunnel.getSourcePort());
        msg.writeInt(tunnel.getDestination().getPort());
        msg.writeString(tunnel.getDestination().getHost());
        msg.writeBoolean(false);
        return msg.toByteArray();
    }

    public void onChannelClose() {
        if (input != null)
            input.close();
View Full Code Here

        msg.writeInt(tunnel.getSourcePort());
        msg.writeString(destHost);
        msg.writeInt(tunnel.getDestination().getPort());
       
       
        Request request = new Request(TunnelingService.START_REMOTE_TUNNEL, msg.toByteArray());
        agent.sendRequest(request, false);
       
      } catch(IOException ex) {
        ex.printStackTrace();
      }
View Full Code Here

                    }
                }
            }
        } finally {
         
        Request request = new Request(TunnelingService.STOP_REMOTE_TUNNEL, msg.toByteArray());
        try {
        agent.sendRequest(request, false);
      } catch (IOException e) {
      }
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.