Package org.apache.datasketches.memory
Class Utf8CodingException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.apache.datasketches.memory.Utf8CodingException
-
- All Implemented Interfaces:
Serializable
public final class Utf8CodingException extends RuntimeException
This exception will be thrown for errors encountered during either the encoding of characters to Utf8 bytes, or the decoding of Utf8 bytes to characters.- Author:
- Lee Rhodes
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Utf8CodingException(String message)
A coding exception occured processing UTF_8
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Utf8CodingException
illegalSurrogatePair(char c1, char c2)
Exception for an illegal surrogate pairstatic Utf8CodingException
illegalUtf8DecodeByteSequence(byte[] bytes)
Exception for an illegal UTF_8 Decode Byte Sequencestatic Utf8CodingException
outOfMemory()
Exception for out-of-memorystatic Utf8CodingException
shortUtf8DecodeByteSequence(byte leadByte, long address, long limit, int required)
Exception for a short UTF_8 Decode Byte Sequencestatic Utf8CodingException
shortUtf8EncodeByteLength(int remaining)
Exception for a short UTF_8 encode byte lengthstatic Utf8CodingException
unpairedSurrogate(char c)
Exception for an unpaired surrogate-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
Utf8CodingException
public Utf8CodingException(String message)
A coding exception occured processing UTF_8- Parameters:
message
- the error message
-
-
Method Detail
-
shortUtf8DecodeByteSequence
public static Utf8CodingException shortUtf8DecodeByteSequence(byte leadByte, long address, long limit, int required)
Exception for a short UTF_8 Decode Byte Sequence- Parameters:
leadByte
- the given lead byteaddress
- the given addresslimit
- the given limitrequired
- what is required- Returns:
- the exception
-
illegalUtf8DecodeByteSequence
public static Utf8CodingException illegalUtf8DecodeByteSequence(byte[] bytes)
Exception for an illegal UTF_8 Decode Byte Sequence- Parameters:
bytes
- the illegal byte sequence- Returns:
- the exception.
-
outOfMemory
public static Utf8CodingException outOfMemory()
Exception for out-of-memory- Returns:
- the exception
-
unpairedSurrogate
public static Utf8CodingException unpairedSurrogate(char c)
Exception for an unpaired surrogate- Parameters:
c
- The last char to encode is an unpaired surrogate- Returns:
- the exception plus the unpaired surrogate character
-
shortUtf8EncodeByteLength
public static Utf8CodingException shortUtf8EncodeByteLength(int remaining)
Exception for a short UTF_8 encode byte length- Parameters:
remaining
- The surrogate pair that is short- Returns:
- the exception plus the surrogate pair that is short
-
illegalSurrogatePair
public static Utf8CodingException illegalSurrogatePair(char c1, char c2)
Exception for an illegal surrogate pair- Parameters:
c1
- the first character of the pairc2
- the second character of the pair- Returns:
- the exception plus the illegal pair
-
-