private TimeZone makeTimeZone(String id, boolean clone) throws IOException { // Check the aliases first String realId = deprecatedAliases.get(id); if (realId != null) { return makeTimeZone(realId, clone); } // Work out where in the big data file this time zone is. int index = Arrays.binarySearch(ids, id); if (index < 0) { return null; } ZoneInfo zoneInfo = zoneInfos[index]; if (zoneInfo != null) { return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; } byte[] bytes = IoUtils.readFileAsByteArray(ZONE_DIRECTORY_NAME + id); BufferIterator it = HeapBufferIterator.iterator(bytes, 0, bytes.length, ByteOrder.BIG_ENDIAN); zoneInfo = (ZoneInfo) ZoneInfo.makeTimeZone(id, it); zoneInfos[index] = zoneInfo; return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; }
private TimeZone makeTimeZone(String id, boolean clone) throws IOException { // Check the aliases first String realId = deprecatedAliases.get(id); if (realId != null) { return makeTimeZone(realId, clone); } // Work out where in the big data file this time zone is. int index = Arrays.binarySearch(ids, id); if (index < 0) { return null; } ZoneInfo zoneInfo = zoneInfos[index]; if (zoneInfo != null) { return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; } byte[] bytes = IoUtils.readFileAsByteArray(ZONE_DIRECTORY_NAME + id); BufferIterator it = HeapBufferIterator.iterator(bytes, 0, bytes.length, ByteOrder.BIG_ENDIAN); zoneInfo = (ZoneInfo) ZoneInfo.makeTimeZone(id, it); zoneInfos[index] = zoneInfo; return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; }
private TimeZone makeTimeZone(String id, boolean clone) throws IOException { // Check the aliases first String realId = deprecatedAliases.get(id); if (realId != null) { return makeTimeZone(realId, clone); } // Work out where in the big data file this time zone is. int index = Arrays.binarySearch(ids, id); if (index < 0) { return null; } ZoneInfo zoneInfo = zoneInfos[index]; if (zoneInfo != null) { return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; } byte[] bytes = IoUtils.readFileAsByteArray(ZONE_DIRECTORY_NAME + id); BufferIterator it = HeapBufferIterator.iterator(bytes, 0, bytes.length, ByteOrder.BIG_ENDIAN); zoneInfo = (ZoneInfo) ZoneInfo.makeTimeZone(id, it); zoneInfos[index] = zoneInfo; return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; }
private TimeZone makeTimeZone(String id, boolean clone) throws IOException { // Check the aliases first String realId = deprecatedAliases.get(id); if (realId != null) { return makeTimeZone(realId, clone); } // Work out where in the big data file this time zone is. int index = Arrays.binarySearch(ids, id); if (index < 0) { return null; } ZoneInfo zoneInfo = zoneInfos[index]; if (zoneInfo != null) { return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; } byte[] bytes = IoUtils.readFileAsByteArray(ZONE_DIRECTORY_NAME + id); BufferIterator it = HeapBufferIterator.iterator(bytes, 0, bytes.length, ByteOrder.BIG_ENDIAN); zoneInfo = (ZoneInfo) ZoneInfo.makeTimeZone(id, it); zoneInfos[index] = zoneInfo; return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; }
private TimeZone makeTimeZone(String id, boolean clone) throws IOException { // Check the aliases first String realId = deprecatedAliases.get(id); if (realId != null) { return makeTimeZone(realId, clone); } // Work out where in the big data file this time zone is. int index = Arrays.binarySearch(ids, id); if (index < 0) { return null; } ZoneInfo zoneInfo = zoneInfos[index]; if (zoneInfo != null) { return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; } byte[] bytes = IoUtils.readFileAsByteArray(ZONE_DIRECTORY_NAME + id); BufferIterator it = HeapBufferIterator.iterator(bytes, 0, bytes.length, ByteOrder.BIG_ENDIAN); zoneInfo = (ZoneInfo) ZoneInfo.makeTimeZone(id, it); zoneInfos[index] = zoneInfo; return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; }
private TimeZone makeTimeZone(String id, boolean clone) throws IOException { // Check the aliases first String realId = deprecatedAliases.get(id); if (realId != null) { return makeTimeZone(realId, clone); } // Work out where in the big data file this time zone is. int index = Arrays.binarySearch(ids, id); if (index < 0) { return null; } ZoneInfo zoneInfo = zoneInfos[index]; if (zoneInfo != null) { return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; } byte[] bytes = IoUtils.readFileAsByteArray(ZONE_DIRECTORY_NAME + id); BufferIterator it = HeapBufferIterator.iterator(bytes, 0, bytes.length, ByteOrder.BIG_ENDIAN); zoneInfo = (ZoneInfo) ZoneInfo.makeTimeZone(id, it); zoneInfos[index] = zoneInfo; return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; }
private TimeZone makeTimeZone(String id, boolean clone) throws IOException { // Check the aliases first String realId = deprecatedAliases.get(id); if (realId != null) { return makeTimeZone(realId, clone); } // Work out where in the big data file this time zone is. int index = Arrays.binarySearch(ids, id); if (index < 0) { return null; } ZoneInfo zoneInfo = zoneInfos[index]; if (zoneInfo != null) { return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; } byte[] bytes = IoUtils.readFileAsByteArray(ZONE_DIRECTORY_NAME + id); BufferIterator it = HeapBufferIterator.iterator(bytes, 0, bytes.length, ByteOrder.BIG_ENDIAN); zoneInfo = (ZoneInfo) ZoneInfo.makeTimeZone(id, it); zoneInfos[index] = zoneInfo; return clone ? (TimeZone) zoneInfo.clone() : zoneInfo; }