/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { DataOutputStream dout = new DataOutputStream(out); writeTo(zoneID, (DataOutput)dout); dout.flush(); } }
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { DataOutputStream dout = new DataOutputStream(out); writeTo(zoneID, (DataOutput)dout); dout.flush(); } }
private void writeZone(File outputDir, DateTimeZoneBuilder builder, DateTimeZone tz) throws IOException { if (ZoneInfoLogger.verbose()) { System.out.println("Writing " + tz.getID()); } File file = new File(outputDir, tz.getID()); if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } OutputStream out = new FileOutputStream(file); try { builder.writeTo(tz.getID(), out); } finally { out.close(); } // Test if it can be read back. InputStream in = new FileInputStream(file); DateTimeZone tz2 = DateTimeZoneBuilder.readFrom(in, tz.getID()); in.close(); if (!tz.equals(tz2)) { System.out.println("*e* Error in " + tz.getID() + ": Didn't read properly from file"); } }
private void writeZone(File outputDir, DateTimeZoneBuilder builder, DateTimeZone tz) throws IOException { if (ZoneInfoLogger.verbose()) { System.out.println("Writing " + tz.getID()); } File file = new File(outputDir, tz.getID()); if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } OutputStream out = new FileOutputStream(file); try { builder.writeTo(tz.getID(), out); } finally { out.close(); } // Test if it can be read back. InputStream in = new FileInputStream(file); DateTimeZone tz2 = DateTimeZoneBuilder.readFrom(in, tz.getID()); in.close(); if (!tz.equals(tz2)) { System.out.println("*e* Error in " + tz.getID() + ": Didn't read properly from file"); } }
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { writeTo(zoneID, (DataOutput)new DataOutputStream(out)); } }
builder.writeTo(zone.iName, out); } finally { out.close();
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { writeTo(zoneID, (DataOutput)new DataOutputStream(out)); } }
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { writeTo(zoneID, (DataOutput)new DataOutputStream(out)); } }
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { writeTo(zoneID, (DataOutput)new DataOutputStream(out)); } }
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { writeTo(zoneID, (DataOutput)new DataOutputStream(out)); } }
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { writeTo(zoneID, (DataOutput)new DataOutputStream(out)); } }
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { writeTo(zoneID, (DataOutput)new DataOutputStream(out)); } }
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { writeTo(zoneID, (DataOutput)new DataOutputStream(out)); } }
/** * Encodes a built DateTimeZone to the given stream. Call readFrom to * decode the data into a DateTimeZone object. * * @param out the output stream to receive the encoded DateTimeZone * @since 1.5 (parameter added) */ public void writeTo(String zoneID, OutputStream out) throws IOException { if (out instanceof DataOutput) { writeTo(zoneID, (DataOutput)out); } else { DataOutputStream dout = new DataOutputStream(out); writeTo(zoneID, (DataOutput)dout); dout.flush(); } }
private void writeZone(File outputDir, DateTimeZoneBuilder builder, DateTimeZone tz) throws IOException { if (ZoneInfoLogger.verbose()) { System.out.println("Writing " + tz.getID()); } File file = new File(outputDir, tz.getID()); if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } OutputStream out = new FileOutputStream(file); try { builder.writeTo(tz.getID(), out); } finally { out.close(); } // Test if it can be read back. InputStream in = new FileInputStream(file); DateTimeZone tz2 = DateTimeZoneBuilder.readFrom(in, tz.getID()); in.close(); if (!tz.equals(tz2)) { System.out.println("*e* Error in " + tz.getID() + ": Didn't read properly from file"); } }
private void writeZone(File outputDir, DateTimeZoneBuilder builder, DateTimeZone tz) throws IOException { if (ZoneInfoLogger.verbose()) { System.out.println("Writing " + tz.getID()); } File file = new File(outputDir, tz.getID()); if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); } OutputStream out = new FileOutputStream(file); try { builder.writeTo(tz.getID(), out); } finally { out.close(); } // Test if it can be read back. InputStream in = new FileInputStream(file); DateTimeZone tz2 = DateTimeZoneBuilder.readFrom(in, tz.getID()); in.close(); if (!tz.equals(tz2)) { System.out.println("*e* Error in " + tz.getID() + ": Didn't read properly from file"); } }
builder.writeTo(zone.iName, out); out.close();
builder.writeTo(zone.iName, out); } finally { out.close();
builder.writeTo(zone.iName, out); } finally { out.close();
builder.writeTo(zone.iName, out); } finally { out.close();