public static CharsetEncoderICU newInstance(Charset cs, String icuCanonicalName) { // This complexity is necessary to ensure that even if the constructor, superclass // constructor, or call to updateCallback throw, we still free the native peer. long address = 0; try { address = NativeConverter.openConverter(icuCanonicalName); float averageBytesPerChar = NativeConverter.getAveBytesPerChar(address); float maxBytesPerChar = NativeConverter.getMaxBytesPerChar(address); byte[] replacement = makeReplacement(icuCanonicalName, address); CharsetEncoderICU result = new CharsetEncoderICU(cs, averageBytesPerChar, maxBytesPerChar, replacement, address); address = 0; // CharsetEncoderICU has taken ownership; its finalizer will do the free. return result; } finally { if (address != 0) { NativeConverter.closeConverter(address); } } }
public static CharsetEncoderICU newInstance(Charset cs, String icuCanonicalName) { // This complexity is necessary to ensure that even if the constructor, superclass // constructor, or call to updateCallback throw, we still free the native peer. long address = 0; try { address = NativeConverter.openConverter(icuCanonicalName); float averageBytesPerChar = NativeConverter.getAveBytesPerChar(address); float maxBytesPerChar = NativeConverter.getMaxBytesPerChar(address); byte[] replacement = makeReplacement(icuCanonicalName, address); CharsetEncoderICU result = new CharsetEncoderICU(cs, averageBytesPerChar, maxBytesPerChar, replacement, address); address = 0; // CharsetEncoderICU has taken ownership; its finalizer will do the free. return result; } finally { if (address != 0) { NativeConverter.closeConverter(address); } } }
public static CharsetEncoderICU newInstance(Charset cs, String icuCanonicalName) { // This complexity is necessary to ensure that even if the constructor, superclass // constructor, or call to updateCallback throw, we still free the native peer. long address = 0; try { address = NativeConverter.openConverter(icuCanonicalName); float averageBytesPerChar = NativeConverter.getAveBytesPerChar(address); float maxBytesPerChar = NativeConverter.getMaxBytesPerChar(address); byte[] replacement = makeReplacement(icuCanonicalName, address); CharsetEncoderICU result = new CharsetEncoderICU(cs, averageBytesPerChar, maxBytesPerChar, replacement, address); address = 0; // CharsetEncoderICU has taken ownership; its finalizer will do the free. return result; } finally { if (address != 0) { NativeConverter.closeConverter(address); } } }
public static CharsetEncoderICU newInstance(Charset cs, String icuCanonicalName) { // This complexity is necessary to ensure that even if the constructor, superclass // constructor, or call to updateCallback throw, we still free the native peer. long address = 0; try { address = NativeConverter.openConverter(icuCanonicalName); float averageBytesPerChar = NativeConverter.getAveBytesPerChar(address); float maxBytesPerChar = NativeConverter.getMaxBytesPerChar(address); byte[] replacement = makeReplacement(icuCanonicalName, address); CharsetEncoderICU result = new CharsetEncoderICU(cs, averageBytesPerChar, maxBytesPerChar, replacement, address); address = 0; // CharsetEncoderICU has taken ownership; its finalizer will do the free. return result; } finally { if (address != 0) { NativeConverter.closeConverter(address); } } }
public static CharsetEncoderICU newInstance(Charset cs, String icuCanonicalName) { // This complexity is necessary to ensure that even if the constructor, superclass // constructor, or call to updateCallback throw, we still free the native peer. long address = 0; try { address = NativeConverter.openConverter(icuCanonicalName); float averageBytesPerChar = NativeConverter.getAveBytesPerChar(address); float maxBytesPerChar = NativeConverter.getMaxBytesPerChar(address); byte[] replacement = makeReplacement(icuCanonicalName, address); CharsetEncoderICU result = new CharsetEncoderICU(cs, averageBytesPerChar, maxBytesPerChar, replacement, address); address = 0; // CharsetEncoderICU has taken ownership; its finalizer will do the free. return result; } finally { if (address != 0) { NativeConverter.closeConverter(address); } } }
public static CharsetEncoderICU newInstance(Charset cs, String icuCanonicalName) { // This complexity is necessary to ensure that even if the constructor, superclass // constructor, or call to updateCallback throw, we still free the native peer. long address = 0; try { address = NativeConverter.openConverter(icuCanonicalName); float averageBytesPerChar = NativeConverter.getAveBytesPerChar(address); float maxBytesPerChar = NativeConverter.getMaxBytesPerChar(address); byte[] replacement = makeReplacement(icuCanonicalName, address); CharsetEncoderICU result = new CharsetEncoderICU(cs, averageBytesPerChar, maxBytesPerChar, replacement, address); address = 0; // CharsetEncoderICU has taken ownership; its finalizer will do the free. return result; } finally { if (address != 0) { NativeConverter.closeConverter(address); } } }
public static CharsetEncoderICU newInstance(Charset cs, String icuCanonicalName) { // This complexity is necessary to ensure that even if the constructor, superclass // constructor, or call to updateCallback throw, we still free the native peer. long address = 0; try { address = NativeConverter.openConverter(icuCanonicalName); float averageBytesPerChar = NativeConverter.getAveBytesPerChar(address); float maxBytesPerChar = NativeConverter.getMaxBytesPerChar(address); byte[] replacement = makeReplacement(icuCanonicalName, address); CharsetEncoderICU result = new CharsetEncoderICU(cs, averageBytesPerChar, maxBytesPerChar, replacement, address); address = 0; // CharsetEncoderICU has taken ownership; its finalizer will do the free. return result; } finally { if (address != 0) { NativeConverter.closeConverter(address); } } }