IT. Expert System.

Android Reference

ModifiedUtf8


java.nio.charset

Class ModifiedUtf8



  • public class ModifiedUtf8
    extends Object
    • Method Summary

      Methods
      Modifier and Type Method and Description
      static long countBytes(String s, boolean shortLength)
      Returns the number of bytes the modified UTF-8 representation of 's' would take.
      static String decode(byte[] in, char[] out, int offset, int utfSize)
      Decodes a byte array containing modified UTF-8 bytes into a string.
      static void encode(byte[] dst, int offset, String s)
      Encodes the modified UTF-8 bytes corresponding to string s into the byte array dst, starting at the given offset.
      static byte[] encode(String s)
      Returns an array containing the modified UTF-8 form of s, using a big-endian 16-bit length.
    • Method Detail

      • decode

        public static String decode(byte[] in,
                    char[] out,
                    int offset,
                    int utfSize)
                             throws UTFDataFormatException
        Decodes a byte array containing modified UTF-8 bytes into a string.

        Note that although this method decodes the (supposedly impossible) zero byte to U+0000, that's what the RI does too.

        Throws:
        UTFDataFormatException
      • countBytes

        public static long countBytes(String s,
                      boolean shortLength)
                               throws UTFDataFormatException
        Returns the number of bytes the modified UTF-8 representation of 's' would take. Note that this is just the space for the bytes representing the characters, not the length which precedes those bytes, because different callers represent the length differently, as two, four, or even eight bytes. If shortLength is true, we'll throw an exception if the string is too long for its length to be represented by a short.
        Throws:
        UTFDataFormatException
      • encode

        public static void encode(byte[] dst,
                  int offset,
                  String s)
        Encodes the modified UTF-8 bytes corresponding to string s into the byte array dst, starting at the given offset.
      • encode

        public static byte[] encode(String s)
                             throws UTFDataFormatException
        Returns an array containing the modified UTF-8 form of s, using a big-endian 16-bit length. Throws UTFDataFormatException if s is too long for a two-byte length.
        Throws:
        UTFDataFormatException


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 480 / 158666234. Delta: 0.11078 с