org.firebirdsql.encodings

## Interface Encoding

-     public interface Encoding

  Encoding translates between a Java string and a byte array for a specific (Firebird) encoding.

  Encoding implementations need to be thread-safe.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `decodeFromCharset(byte[] in)` Decodes the supplied byte array to a String.
    `java.lang.String` | `decodeFromCharset(byte[] in, int offset, int length)` Decodes a part of the supplied byte array to a String.
    `byte[]` | `encodeToCharset(java.lang.String in)` Encodes the supplied String to bytes in this encoding.
    `java.lang.String` | `getCharsetName()`
    `Encoding` | `withTranslation(CharacterTranslator translator)` Deprecated. To be removed in Jaybird 4

- - ### Method Detail

    - #### encodeToCharset

          byte[] encodeToCharset(java.lang.String in)

      Encodes the supplied String to bytes in this encoding.
      Parameters:
        `in` - String to encode
      Returns:
        Byte array with encoded string

    - #### decodeFromCharset

          java.lang.String decodeFromCharset(byte[] in)

      Decodes the supplied byte array to a String.
      Parameters:
        `in` - byte array to decode
      Returns:
        String after decoding the byte array

    - #### decodeFromCharset

          java.lang.String decodeFromCharset(byte[] in,
                                           int offset,
                                           int length)

      Decodes a part of the supplied byte array to a String.
      Parameters:
        `in` - byte array to decode
        `offset` - Offset into the byte array
        `length` - Length in bytes to decode
      Returns:
        String after decoding the byte array

    - #### withTranslation

          @Deprecated
          Encoding withTranslation(CharacterTranslator translator)

      Deprecated. To be removed in Jaybird 4
      Derives an `Encoding` that applies the specified character translation.
      Parameters:
        `translator` - The translation to apply
      Returns:
        The derived Encoding, or this encoding if `translator` is `null`

    - #### getCharsetName

          java.lang.String getCharsetName()

      Returns:
        The name of the Java character set.

Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.