⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 localeutildecoderreal.java

📁 java 文件下载器。可自定义
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   LocaleUtilDecoderReal.java

package org.gudy.azureus2.core3.internat;

import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.*;
import java.util.Arrays;
import org.gudy.azureus2.core3.util.Debug;

// Referenced classes of package org.gudy.azureus2.core3.internat:
//			LocaleUtilDecoder

public class LocaleUtilDecoderReal
	implements LocaleUtilDecoder
{

	protected CharsetDecoder decoder;
	protected int index;

	protected LocaleUtilDecoderReal(int _index, CharsetDecoder _decoder)
	{
		index = _index;
		decoder = _decoder;
	}

	public String getName()
	{
		return decoder.charset().name();
	}

	public int getIndex()
	{
		return index;
	}

	public String tryDecode(byte array[], boolean lax)
	{
		String str;
		ByteBuffer bb = ByteBuffer.wrap(array);
		CharBuffer cb = CharBuffer.allocate(array.length);
		CoderResult cr = decoder.decode(bb, cb, true);
		if (cr.isError())
			break MISSING_BLOCK_LABEL_76;
		cb.flip();
		str = cb.toString();
		if (lax)
			return str;
		byte b2[] = str.getBytes(getName());
		if (Arrays.equals(array, b2))
			return str;
		return null;
		Throwable e;
		e;
		return null;
	}

	public String decodeString(byte bytes[])
		throws UnsupportedEncodingException
	{
		CharBuffer cb;
		CoderResult cr;
		if (bytes == null)
			return null;
		ByteBuffer bb = ByteBuffer.wrap(bytes);
		cb = CharBuffer.allocate(bytes.length);
		cr = decoder.decode(bb, cb, true);
		String str;
		byte b2[];
		if (cr.isError())
			break MISSING_BLOCK_LABEL_82;
		cb.flip();
		str = cb.toString();
		b2 = str.getBytes(decoder.charset().name());
		if (Arrays.equals(bytes, b2))
			return str;
		break MISSING_BLOCK_LABEL_82;
		Throwable e;
		e;
		return new String(bytes, "UTF8");
		e;
		Debug.printStackTrace(e);
		return new String(bytes);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -