Socket (Groovy JDK enhancements)

Package: java.net

## Class Socket

- - ### Methods Summary

    Methods
    Return type | Name and parameters
    --- | ---
    `OutputStream` | `leftShift(byte[] value)` Overloads the left shift operator to provide an append mechanism to add bytes to the output stream of a socket
    `Writer` | `leftShift(Object value)` Overloads the left shift operator to provide an append mechanism to add things to the output stream of a socket
    `Object` | `withObjectStreams(Closure closure)` Creates an InputObjectStream and an OutputObjectStream from a Socket, and passes them to the closure.
    `Object` | `withStreams(Closure closure)` Passes the Socket's InputStream and OutputStream to the closure.

  - #### Methods inherited from class java.lang.Object

    `addShutdownHook`, `any`, `any`, `asBoolean`, `asType`, `collect`, `collect`, `collect`, `contains`, `count`, `dump`, `each`, `eachWithIndex`, `equals`, `every`, `every`, `find`, `find`, `findAll`, `findAll`, `findIndexOf`, `findIndexOf`, `findIndexValues`, `findIndexValues`, `findLastIndexOf`, `findLastIndexOf`, `findResult`, `findResult`, `flatten`, `getAt`, `getMetaClass`, `getMetaPropertyValues`, `getProperties`, `grep`, `grep`, `groupBy`, `groupBy`, `hasProperty`, `identity`, `inject`, `inject`, `inspect`, `invokeMethod`, `is`, `isCase`, `iterator`, `join`, `metaClass`, `print`, `print`, `printf`, `printf`, `println`, `println`, `println`, `putAt`, `respondsTo`, `respondsTo`, `setMetaClass`, `size`, `split`, `sprintf`, `sprintf`, `sum`, `sum`, `tap`, `toArrayString`, `toSpreadMap`, `toString`, `use`, `use`, `use`, `with`, `with`, `withTraits`

  - #### Methods inherited from interface java.io.Closeable

    `withCloseable`

  - #### Methods inherited from interface java.lang.AutoCloseable

    `withCloseable`

- - ### Methods Detail

    - #### public OutputStream leftShift(byte[] value)

      Overloads the left shift operator to provide an append mechanism to add bytes to the output stream of a socket

      Parameters:
        `value` - a value to append
      Returns:
        an OutputStream
      Since:
        1.0

    - #### public Writer leftShift(Object value)

      Overloads the left shift operator to provide an append mechanism to add things to the output stream of a socket

      Parameters:
        `value` - a value to append
      Returns:
        a Writer
      Since:
        1.0

    - #### public Object withObjectStreams(Closure closure)

      Creates an InputObjectStream and an OutputObjectStream from a Socket, and passes them to the closure. The streams will be closed after the closure returns, even if an exception is thrown.

      Parameters:
        `closure` - a Closure
      Returns:
        the value returned by the closure
      Since:
        1.5.0

    - #### public Object withStreams(Closure closure)

      Passes the Socket's InputStream and OutputStream to the closure. The streams will be closed after the closure returns, even if an exception is thrown.

      Parameters:
        `closure` - a Closure
      Returns:
        the value returned by the closure
      Since:
        1.5.2