| Modifier and Type | Class and Description |
|---|---|
| private static class | RubyEncoding.
A cached decoder object to decode bytes as raw binary (ISO-8859-1 or ASCII-8BIT) content. |
| private static class | RubyEncoding.
A cached decoder for UTF-8 bytes. |
| Modifier and Type | Field and Description |
|---|---|
| public static final ByteList | |
| private static final int | CHAR_THRESHOLD
The maximum number of characters we can encode/decode in our cached buffers |
| private final transient Object | |
| private Encoding | |
| public static final ByteList | |
| public static final ByteList | |
| public static final ByteList | |
| private final boolean | |
| public static final Charset | |
| public static final ByteList | |
| private final ByteList | |
| private static final ThreadLocal | RAW_CODER
Thread-local RawCoder wrapped in a SoftReference to avoid possible ClassLoader leak. |
| public static final Charset | |
| public static final Charset | |
| private static final ThreadLocal | UTF8_CODER
Thread-local UTF8Coder wrapped in a SoftReference to avoid possible ClassLoader leak. |
| Access | Constructor and Description |
|---|---|
| private | |
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public IRubyObject | |
| public static IRubyObject | |
| private static void | |
| public static IRubyObject | |
| public static Encoding | |
| public static Encoding | |
| public IRubyObject | |
| public static Encoding | Returns: a negotiated encoding, if compatible; null otherwisethe current thread context context, Encoding the first encoding encoding, CodeRangeable the other)CodeRangeable from which to get bytes and the second encodingCheck whether the given encoding and the encoding from the given |
| public static IRubyObject | |
| public Object | |
| public static RubyClass | |
| public static String | |
| public static String | |
| public static String | |
| public static String | |
| public static String | Returns: a decoded String based on raw bytesthe byte array bytes, int start of content start, int length of content length)Decode the range of bytes specified as "raw" binary content, as in ISO-8859-1 or ASCII-8BIT encodings. |
| public static String | |
| private static char[] | |
| public static String | Returns: a decoded String based on UTF-8 bytesthe byte array bytes, int start of content start, int length of content length)Decode the range of bytes specified as UTF-8 content. |
| public static String | |
| pack-priv static ByteList | |
| pack-priv static ByteList | |
| pack-priv static ByteList | |
| pack-priv static ByteList | |
| pack-priv static ByteList | |
| pack-priv static ByteList | |
| public IRubyObject | |
| public static byte[] | |
| public static byte[] | |
| public static byte[] | |
| public static byte[] | |
| private static byte[] | |
| private static byte[] | |
| public static byte[] | |
| public static byte[] | |
| public static byte[] | |
| public static byte[] | |
| private static Encoding | |
| public static IRubyObject | |
| private static ByteList | |
| private static byte[] | |
| public static IRubyObject | |
| public static IRubyObject | |
| public static IRubyObject | |
| public final Encoding | |
| private static RubyEncoding. | |
| private static RubyEncoding. | |
| public IRubyObject | inspect(ThreadContext context)
Overrides org. Overrides default org. Returns a string containing a human-readable representation of obj. |
| private ByteList | |
| public static IRubyObject | |
| public static IRubyObject | |
| public static IRubyObject | |
| public IRubyObject | |
| public static RubyEncoding | |
| public IRubyObject | |
| public static IRubyObject | |
| public static IRubyObject | |
| public IRubyObject | |
| private static CharBuffer |
| BINARY_ASCII_NAME | back to summary |
|---|---|
| public static final ByteList BINARY_ASCII_NAME | |
| CHAR_THRESHOLD | back to summary |
|---|---|
| private static final int CHAR_THRESHOLD The maximum number of characters we can encode/decode in our cached buffers | |
| constant | back to summary |
|---|---|
| private final transient Object constant | |
| encoding | back to summary |
|---|---|
| private Encoding encoding | |
| EXTERNAL | back to summary |
|---|---|
| public static final ByteList EXTERNAL | |
| FILESYSTEM | back to summary |
|---|---|
| public static final ByteList FILESYSTEM | |
| INTERNAL | back to summary |
|---|---|
| public static final ByteList INTERNAL | |
| isDummy | back to summary |
|---|---|
| private final boolean isDummy | |
| ISO | back to summary |
|---|---|
| public static final Charset ISO | |
| LOCALE | back to summary |
|---|---|
| public static final ByteList LOCALE | |
| name | back to summary |
|---|---|
| private final ByteList name | |
| RAW_CODER | back to summary |
|---|---|
| private static final ThreadLocal<SoftReference<RubyEncoding. Thread-local RawCoder wrapped in a SoftReference to avoid possible ClassLoader leak. See JRUBY-6522 | |
| UTF16 | back to summary |
|---|---|
| public static final Charset UTF16 | |
| UTF8 | back to summary |
|---|---|
| public static final Charset UTF8 | |
| UTF8_CODER | back to summary |
|---|---|
| private static final ThreadLocal<SoftReference<RubyEncoding. Thread-local UTF8Coder wrapped in a SoftReference to avoid possible ClassLoader leak. See JRUBY-6522 | |
| RubyEncoding | back to summary |
|---|---|
| private RubyEncoding(Ruby runtime, byte[] name, int p, int end, boolean isDummy) | |
| RubyEncoding | back to summary |
|---|---|
| private RubyEncoding(Ruby runtime, byte[] name, Encoding encoding, boolean isDummy) | |
| RubyEncoding | back to summary |
|---|---|
| private RubyEncoding(Ruby runtime, ByteList name, Encoding encoding, boolean isDummy) | |
| _dump | back to summary |
|---|---|
public IRubyObject _dump(ThreadContext context, IRubyObject arg)
| |
| _load | back to summary |
|---|---|
public static IRubyObject _load(ThreadContext context, IRubyObject recv, IRubyObject str)
| |
| addSpecialAlias | back to summary |
|---|---|
| private static void addSpecialAlias(ThreadContext context, RubyHash result, ByteList alias, Encoding encoding) | |
| aliases | back to summary |
|---|---|
public static IRubyObject aliases(ThreadContext context, IRubyObject recv)
| |
| areCompatible | back to summary |
|---|---|
| public static Encoding areCompatible(IRubyObject obj1, IRubyObject obj2) | |
| areCompatible | back to summary |
|---|---|
| public static Encoding areCompatible(Encoding enc1, int cr1, Encoding enc2, int cr2) | |
| asciiCompatible_p | back to summary |
|---|---|
public IRubyObject asciiCompatible_p(ThreadContext context)
| |
| checkEncoding | back to summary |
|---|---|
| public static Encoding checkEncoding(ThreadContext context, Encoding encoding, CodeRangeable other) Check whether the given encoding and the encoding from the given
| |
| compatible_p | back to summary |
|---|---|
public static IRubyObject compatible_p(ThreadContext context, IRubyObject self, IRubyObject first, IRubyObject second)
| |
| constant | back to summary |
|---|---|
| public Object constant() Implements org.
| |
| createEncodingClass | back to summary |
|---|---|
| public static RubyClass createEncodingClass(ThreadContext context, RubyClass Object) | |
| decode | back to summary |
|---|---|
| public static String decode(byte[] bytes, int start, int length, Charset charset) | |
| decode | back to summary |
|---|---|
| public static String decode(byte[] bytes, Charset charset) | |
| decodeISO | back to summary |
|---|---|
| public static String decodeISO(byte[] bytes, int start, int length)
Deprecated
| |
| decodeISO | back to summary |
|---|---|
| public static String decodeISO(ByteList byteList)
Deprecated
| |
| decodeRaw | back to summary |
|---|---|
| public static String decodeRaw(byte[] bytes, int start, int length) Decode the range of bytes specified as "raw" binary content, as in ISO-8859-1 or ASCII-8BIT encodings.
This will attempt to use a zero-allocation decoder if the content length is shorter than
| |
| decodeRaw | back to summary |
|---|---|
| public static String decodeRaw(ByteList byteList) Decode the specified bytelist as "raw" binary content.
This is the same as calling
| |
| decodeRawLoop | back to summary |
|---|---|
| private static char[] decodeRawLoop(byte[] s, int start, int length) | |
| decodeUTF8 | back to summary |
|---|---|
| public static String decodeUTF8(byte[] bytes, int start, int length) Decode the range of bytes specified as UTF-8 content.
This will attempt to use a zero-allocation decoder if the content length is shorter than
| |
| decodeUTF8 | back to summary |
|---|---|
| public static String decodeUTF8(byte[] bytes) | |
| doEncode | back to summary |
|---|---|
| pack-priv static ByteList doEncode(String cs, Charset charset, Encoding enc) | |
| doEncode | back to summary |
|---|---|
| pack-priv static ByteList doEncode(CharSequence cs, Charset charset, Encoding enc) | |
| doEncodeUTF16 | back to summary |
|---|---|
| pack-priv static ByteList doEncodeUTF16(String str) | |
| doEncodeUTF16 | back to summary |
|---|---|
| pack-priv static ByteList doEncodeUTF16(CharSequence str) | |
| doEncodeUTF8 | back to summary |
|---|---|
| pack-priv static ByteList doEncodeUTF8(String str) | |
| doEncodeUTF8 | back to summary |
|---|---|
| pack-priv static ByteList doEncodeUTF8(CharSequence str) | |
| dummy_p | back to summary |
|---|---|
public IRubyObject dummy_p(ThreadContext context)
| |
| encode | back to summary |
|---|---|
| public static byte[] encode(CharSequence cs, Charset charset) | |
| encode | back to summary |
|---|---|
| public static byte[] encode(String str, Charset charset) | |
| encodeISO | back to summary |
|---|---|
| public static byte[] encodeISO(CharSequence str) | |
| encodeISO | back to summary |
|---|---|
| public static byte[] encodeISO(char[] str) | |
| encodeISOLoop | back to summary |
|---|---|
| private static byte[] encodeISOLoop(char[] s) | |
| encodeISOLoop | back to summary |
|---|---|
| private static byte[] encodeISOLoop(CharSequence s) | |
| encodeUTF16 | back to summary |
|---|---|
| public static byte[] encodeUTF16(String str) | |
| encodeUTF16 | back to summary |
|---|---|
| public static byte[] encodeUTF16(CharSequence str) | |
| encodeUTF8 | back to summary |
|---|---|
| public static byte[] encodeUTF8(String str) | |
| encodeUTF8 | back to summary |
|---|---|
| public static byte[] encodeUTF8(CharSequence str) | |
| extractEncodingFromObject | back to summary |
|---|---|
| private static Encoding extractEncodingFromObject(IRubyObject obj) | |
| find | back to summary |
|---|---|
public static IRubyObject find(ThreadContext context, IRubyObject recv, IRubyObject str)
| |
| getByteList | back to summary |
|---|---|
| private static ByteList getByteList(final ByteBuffer buffer, final Encoding enc, final boolean shared) | |
| getBytes | back to summary |
|---|---|
| private static byte[] getBytes(final ByteBuffer buffer) | |
| getDefaultExternal | back to summary |
|---|---|
public static IRubyObject getDefaultExternal(ThreadContext context, IRubyObject recv)
| |
| getDefaultInternal | back to summary |
|---|---|
public static IRubyObject getDefaultInternal(ThreadContext context, IRubyObject recv)
| |
| getDefaultInternal | back to summary |
|---|---|
| public static IRubyObject getDefaultInternal(IRubyObject recv)
Deprecated
| |
| getEncoding | back to summary |
|---|---|
| public final Encoding getEncoding() | |
| getRawCoder | back to summary |
|---|---|
| private static RubyEncoding. | |
| getUTF8Coder | back to summary |
|---|---|
| private static RubyEncoding. | |
| inspect | back to summary |
|---|---|
| public IRubyObject inspect(ThreadContext context) Overrides org. Overrides default org. Doc from org. Returns a string containing a human-readable representation of
obj. If not overridden, uses the
| |
| inspectName | back to summary |
|---|---|
| private ByteList inspectName() | |
| list | back to summary |
|---|---|
public static IRubyObject list(ThreadContext context, IRubyObject recv)
| |
| locale_charmap | back to summary |
|---|---|
public static IRubyObject locale_charmap(ThreadContext context, IRubyObject recv)
| |
| name_list | back to summary |
|---|---|
public static IRubyObject name_list(ThreadContext context, IRubyObject recv)
| |
| names | back to summary |
|---|---|
public IRubyObject names(ThreadContext context)
| |
| newEncoding | back to summary |
|---|---|
| public static RubyEncoding newEncoding(Ruby runtime, byte[] name, int p, int end, boolean isDummy) | |
| replicate | back to summary |
|---|---|
| public IRubyObject replicate(ThreadContext context, IRubyObject arg)
Deprecated since 10.0.
| |
| setDefaultExternal | back to summary |
|---|---|
public static IRubyObject setDefaultExternal(ThreadContext context, IRubyObject recv, IRubyObject encoding)
| |
| setDefaultInternal | back to summary |
|---|---|
public static IRubyObject setDefaultInternal(ThreadContext context, IRubyObject recv, IRubyObject encoding)
| |
| to_s | back to summary |
|---|---|
| public IRubyObject to_s(ThreadContext context) Overrides org.
| |
| toCharBuffer | back to summary |
|---|---|
| private static CharBuffer toCharBuffer(CharSequence str) | |
| Modifier and Type | Field and Description |
|---|---|
| private final char[] |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public final String |
| charBuffer | back to summary |
|---|---|
| private final char[] charBuffer | |
| RawCoder | back to summary |
|---|---|
| private RawCoder() | |
| decode | back to summary |
|---|---|
| public final String decode(byte[] bytes, int start, int length) | |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | BUF_SIZE
The resulting encode/decode buffer sized by the max number of characters (using 4 bytes per char possible for utf-8) |
| private final ByteBuffer | |
| private final CharBuffer | |
| private final CharsetDecoder | |
| private final CharsetEncoder |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final CharBuffer | |
| public final ByteBuffer | |
| public final ByteBuffer |
| BUF_SIZE | back to summary |
|---|---|
| private static final int BUF_SIZE The resulting encode/decode buffer sized by the max number of characters (using 4 bytes per char possible for utf-8) | |
| byteBuffer | back to summary |
|---|---|
| private final ByteBuffer byteBuffer | |
| charBuffer | back to summary |
|---|---|
| private final CharBuffer charBuffer | |
| decoder | back to summary |
|---|---|
| private final CharsetDecoder decoder | |
| encoder | back to summary |
|---|---|
| private final CharsetEncoder encoder | |
| UTF8Coder | back to summary |
|---|---|
| pack-priv UTF8Coder() | |
| decode | back to summary |
|---|---|
| public final CharBuffer decode(byte[] bytes, int start, int length) | |
| encode | back to summary |
|---|---|
| public final ByteBuffer encode(String str) | |
| encode | back to summary |
|---|---|
| public final ByteBuffer encode(CharSequence str) | |