nxt.util

## Class Convert

- java.lang.Object
- - nxt.util.Convert

-     public final class Convert
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.util.Comparator<byte[]>` | `byteArrayComparator`
    `static byte[]` | `EMPTY_BYTE`
    `static byte[][]` | `EMPTY_BYTES`
    `static long[]` | `EMPTY_LONG`
    `static java.lang.String[]` | `EMPTY_STRING`
    `static java.math.BigInteger` | `two64`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static byte[]` | `compress(byte[] bytes)`
    `static byte[]` | `emptyToNull(byte[] bytes)`
    `static java.lang.String` | `emptyToNull(java.lang.String s)`
    `static long` | `fromEpochTime(int epochTime)`
    `static long` | `fullHashToId(byte[] hash)`
    `static int` | `getMaxStringSize(int length)`
    `static long` | `longValueExact(java.math.BigInteger bigInteger)`
    `static byte[][]` | `nullToEmpty(byte[][] bytes)`
    `static long[]` | `nullToEmpty(long[] array)`
    `static java.lang.String` | `nullToEmpty(java.lang.String s)`
    `static long` | `nullToZero(java.lang.Long l)`
    `static long` | `parseAccountId(java.lang.String account)`
    `static byte[]` | `parseHexString(java.lang.String hex)`
    `static long` | `parseLong(java.lang.Object o)`
    `static long` | `parseNXT(java.lang.String nxt)`
    `static long` | `parseUnsignedLong(java.lang.String number)`
    `static java.lang.String` | `readString(java.nio.ByteBuffer buffer, int numBytes, int maxLength)`
    `static java.lang.String` | `rsAccount(long accountId)`
    `static long[]` | `toArray(java.util.List<java.lang.Long> list)`
    `static java.lang.Long[]` | `toArray(long[] array)`
    `static long[]` | `toArray(java.lang.Long[] array)`
    `static byte[]` | `toBytes(long n)`
    `static byte[]` | `toBytes(java.lang.String s)`
    `static byte[]` | `toBytes(java.lang.String s, boolean isText)`
    `static int` | `toEpochTime(long currentTime)`
    `static java.lang.String` | `toHexString(byte[] bytes)`
    `static java.util.List<java.lang.Long>` | `toList(long[] array)`
    `static java.util.Set<java.lang.Long>` | `toSet(long[] array)`
    `static java.lang.String` | `toString(byte[] bytes)`
    `static java.lang.String` | `toString(byte[] bytes, boolean isText)`
    `static java.lang.String` | `truncate(java.lang.String s, java.lang.String replaceNull, int limit, boolean dots)`
    `static byte[]` | `uncompress(byte[] bytes)`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### two64

          public static final java.math.BigInteger two64

    - #### EMPTY_LONG

          public static final long[] EMPTY_LONG

    - #### EMPTY_BYTE

          public static final byte[] EMPTY_BYTE

    - #### EMPTY_BYTES

          public static final byte[][] EMPTY_BYTES

    - #### EMPTY_STRING

          public static final java.lang.String[] EMPTY_STRING

    - #### byteArrayComparator

          public static final java.util.Comparator<byte[]> byteArrayComparator

  - ### Method Detail

    - #### parseHexString

          public static byte[] parseHexString(java.lang.String hex)

    - #### toHexString

          public static java.lang.String toHexString(byte[] bytes)

    - #### parseUnsignedLong

          public static long parseUnsignedLong(java.lang.String number)

    - #### parseLong

          public static long parseLong(java.lang.Object o)

    - #### parseAccountId

          public static long parseAccountId(java.lang.String account)

    - #### rsAccount

          public static java.lang.String rsAccount(long accountId)

    - #### fullHashToId

          public static long fullHashToId(byte[] hash)

    - #### fromEpochTime

          public static long fromEpochTime(int epochTime)

    - #### toEpochTime

          public static int toEpochTime(long currentTime)

    - #### emptyToNull

          public static java.lang.String emptyToNull(java.lang.String s)

    - #### nullToEmpty

          public static java.lang.String nullToEmpty(java.lang.String s)

    - #### emptyToNull

          public static byte[] emptyToNull(byte[] bytes)

    - #### nullToEmpty

          public static byte[][] nullToEmpty(byte[][] bytes)

    - #### nullToEmpty

          public static long[] nullToEmpty(long[] array)

    - #### nullToZero

          public static long nullToZero(java.lang.Long l)

    - #### toArray

          public static long[] toArray(java.util.List<java.lang.Long> list)

    - #### toList

          public static java.util.List<java.lang.Long> toList(long[] array)

    - #### toArray

          public static java.lang.Long[] toArray(long[] array)

    - #### toArray

          public static long[] toArray(java.lang.Long[] array)

    - #### toSet

          public static java.util.Set<java.lang.Long> toSet(long[] array)

    - #### toBytes

          public static byte[] toBytes(java.lang.String s)

    - #### toBytes

          public static byte[] toBytes(java.lang.String s,
                                       boolean isText)

    - #### toString

          public static java.lang.String toString(byte[] bytes)

    - #### toString

          public static java.lang.String toString(byte[] bytes,
                                                  boolean isText)

    - #### toBytes

          public static byte[] toBytes(long n)

    - #### readString

          public static java.lang.String readString(java.nio.ByteBuffer buffer,
                                                    int numBytes,
                                                    int maxLength)
                                             throws NxtException.NotValidException

      Throws:
        `NxtException.NotValidException`

    - #### getMaxStringSize

          public static int getMaxStringSize(int length)

    - #### truncate

          public static java.lang.String truncate(java.lang.String s,
                                                  java.lang.String replaceNull,
                                                  int limit,
                                                  boolean dots)

    - #### parseNXT

          public static long parseNXT(java.lang.String nxt)

    - #### compress

          public static byte[] compress(byte[] bytes)

    - #### uncompress

          public static byte[] uncompress(byte[] bytes)

    - #### longValueExact

          public static long longValueExact(java.math.BigInteger bigInteger)