Package: java.lang

## [Java] Class Byte[]

- java.lang.Byte[]

-     public class Byte[]
      extends Object

  GDK enhancements for Byte[].

  displayName:
    Byte[]
  receiverFqcn:
    java.lang.Byte[]

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `eachByte(Closure<?> closure)` Traverses through each byte of this Byte array.
    `` | `public Writable` | `encodeBase64(boolean chunked)` Produce a Writable object which writes the Base64 encoding of the byte array.
    `` | `public Writable` | `encodeBase64()` Produce a Writable object which writes the Base64 encoding of the byte array.
    `` | `public Writable` | `encodeBase64Url()` Produce a Writable object which writes the Base64 URL and Filename Safe encoding of the byte array.
    `` | `public Writable` | `encodeBase64Url(boolean pad)` Produce a Writable object which writes the Base64 URL and Filename Safe encoding of the byte array.
    `` | `public Writable` | `encodeHex()` Produces a Writable that writes the hex encoding of the Byte[].

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, clamp, clamp, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, takeIf, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### public void eachByte(Closure<?> closure)

      Traverses through each byte of this Byte array. Alias for each.

      Parameters:
        `closure` - a closure
      Since:
        1.5.5

    - #### public Writable encodeBase64(boolean chunked)

      Produce a Writable object which writes the Base64 encoding of the byte array. Calling toString() on the result returns the encoding as a String. For more information on Base64 encoding and chunking see `RFC 4648`.

      Parameters:
        `chunked` - whether the Base64 encoded data should be MIME chunked
      Returns:
        object which will write the Base64 encoding of the byte array
      Since:
        1.5.1

    - #### public Writable encodeBase64()

      Produce a Writable object which writes the Base64 encoding of the byte array. Calling toString() on the result returns the encoding as a String. For more information on Base64 encoding and chunking see `RFC 4648`.

      Returns:
        object which will write the Base64 encoding of the byte array
      Since:
        1.0

    - #### public Writable encodeBase64Url()

      Produce a Writable object which writes the Base64 URL and Filename Safe encoding of the byte array. Calling toString() on the result returns the encoding as a String. For more information on Base64 URL and Filename Safe encoding see `RFC 4648 - Section 5 Base 64 Encoding with URL and Filename Safe Alphabet`.

      The method omits padding and is equivalent to calling EncodingGroovyMethods.encodeBase64Url with a value of `false`.

      Returns:
        object which will write the Base64 URL and Filename Safe encoding of the byte array
      See Also:
        EncodingGroovyMethods.encodeBase64Url
      Since:
        2.5.0

    - #### public Writable encodeBase64Url(boolean pad)

      Produce a Writable object which writes the Base64 URL and Filename Safe encoding of the byte array. Calling toString() on the result returns the encoding as a String. For more information on Base64 URL and Filename Safe encoding see `RFC 4648 - Section 5 Base 64 Encoding with URL and Filename Safe Alphabet`.

      Parameters:
        `pad` - whether the encoded data should be padded
      Returns:
        object which will write the Base64 URL and Filename Safe encoding of the byte array
      Since:
        2.5.0

    - #### public Writable encodeHex()

      Produces a Writable that writes the hex encoding of the Byte[]. Calling toString() on this Writable returns the hex encoding as a String. The hex encoding includes two characters for each byte and all letters are lower case.

      Returns:
        object which will write the hex encoding of the byte array
      See Also:
        Integer.toHexString