Java Socket Write writeData(Socket id, byte[] data, int len)

Here you can find the source of writeData(Socket id, byte[] data, int len)

Description

Method writeData

License

Open Source License

Parameter

Parameter Description
id a Socket
data a byte[]
len an int

Exception

Parameter Description
IOException an exception

Declaration

static void writeData(Socket id, byte[] data, int len)
        throws IOException 

Method Source Code

//package com.java2s;
import java.io.IOException;

import java.io.OutputStream;
import java.net.Socket;

public class Main {
    /**/*from   w  ww .ja v  a2 s  .  c o m*/
     * Method writeData
     *
     * @param    id                  a  Socket
     * @param    data                a  byte[]
     * @param    len                 an int
     *
     * @throws   IOException
     *
     */
    static void writeData(Socket id, byte[] data, int len)
            throws IOException {
        OutputStream output;
        output = id.getOutputStream();

        output.write(data, 0, len);
    }
}

Related

  1. createWriter(Socket socket)
  2. getOutputStream(Socket socket)
  3. getOutputStreamFromSocket(final Socket socket)
  4. getWriter(Socket socket)
  5. openWriter(Socket socket)
  6. writeDatasIntoSocket(Socket socket, String datas)
  7. writeFromServer(Socket sck, String row)
  8. writeOutputStream(Socket socket, StringBuffer sb)
  9. writeUTF(final Socket socket, final String out)