@Override public URL readObject(ObjectInput input) throws IOException, ClassNotFoundException { return DefaultExternalizer.URI.cast(URI.class).readObject(input).toURL(); }
@Override public LocalDateTime readObject(ObjectInput input) throws IOException, ClassNotFoundException { LocalDate date = DefaultExternalizer.LOCAL_DATE.cast(LocalDate.class).readObject(input); LocalTime time = DefaultExternalizer.LOCAL_TIME.cast(LocalTime.class).readObject(input); return LocalDateTime.of(date, time); }
@Override public void writeObject(ObjectOutput output, URL url) throws IOException { try { DefaultExternalizer.URI.cast(URI.class).writeObject(output, url.toURI()); } catch (URISyntaxException e) { throw new IOException(e); } }
@Override public InetSocketAddress readObject(ObjectInput input) throws IOException, ClassNotFoundException { InetAddress address = DefaultExternalizer.INET_ADDRESS.cast(InetAddress.class).readObject(input); int port = IndexSerializer.UNSIGNED_SHORT.readInt(input); return (address != null) ? new InetSocketAddress(address, port) : InetSocketAddress.createUnresolved(input.readUTF(), port); }
@Override public YearMonth readObject(ObjectInput input) throws IOException, ClassNotFoundException { int year = input.readInt(); Month month = DefaultExternalizer.MONTH.cast(Month.class).readObject(input); return YearMonth.of(year, month); }
@Override public void writeObject(ObjectOutput output, YearMonth value) throws IOException { output.writeInt(value.getYear()); DefaultExternalizer.MONTH.cast(Month.class).writeObject(output, value.getMonth()); }
@Override public MonthDay readObject(ObjectInput input) throws IOException, ClassNotFoundException { Month month = DefaultExternalizer.MONTH.cast(Month.class).readObject(input); int day = IndexSerializer.UNSIGNED_BYTE.readInt(input); return MonthDay.of(month, day); }
@Override public SessionAttributeKey readObject(ObjectInput input) throws IOException, ClassNotFoundException { String sessionId = SessionIdentifierSerializer.INSTANCE.read(input); UUID attributeId = DefaultExternalizer.UUID.cast(UUID.class).readObject(input); return new SessionAttributeKey(sessionId, attributeId); }
@Override public void writeObject(ObjectOutput output, SessionAttributeKey key) throws IOException { SessionIdentifierSerializer.INSTANCE.write(output, key.getValue()); DefaultExternalizer.UUID.cast(UUID.class).writeObject(output, key.getAttributeId()); }
@Override public void writeObject(ObjectOutput output, SessionCreationMetaDataEntry<Object> entry) throws IOException { SessionCreationMetaData metaData = entry.getMetaData(); DefaultExternalizer.INSTANT.cast(Instant.class).writeObject(output, metaData.getCreationTime()); IndexSerializer.VARIABLE.writeInt(output, (int) metaData.getMaxInactiveInterval().getSeconds()); }
@Override public SessionCreationMetaDataEntry<Object> readObject(ObjectInput input) throws IOException, ClassNotFoundException { SessionCreationMetaData metaData = new SimpleSessionCreationMetaData(DefaultExternalizer.INSTANT.cast(Instant.class).readObject(input)); metaData.setMaxInactiveInterval(Duration.ofSeconds(IndexSerializer.VARIABLE.readInt(input))); return new SessionCreationMetaDataEntry<>(metaData); }
@Override public void writeObject(ObjectOutput output, MonthDay monthDay) throws IOException { DefaultExternalizer.MONTH.cast(Month.class).writeObject(output, monthDay.getMonth()); IndexSerializer.UNSIGNED_BYTE.writeInt(output, monthDay.getDayOfMonth()); }
@Override public LocalDateTime readObject(ObjectInput input) throws IOException, ClassNotFoundException { LocalDate date = DefaultExternalizer.LOCAL_DATE.cast(LocalDate.class).readObject(input); LocalTime time = DefaultExternalizer.LOCAL_TIME.cast(LocalTime.class).readObject(input); return LocalDateTime.of(date, time); }
@Override public LocalDateTime readObject(ObjectInput input) throws IOException, ClassNotFoundException { LocalDate date = DefaultExternalizer.LOCAL_DATE.cast(LocalDate.class).readObject(input); LocalTime time = DefaultExternalizer.LOCAL_TIME.cast(LocalTime.class).readObject(input); return LocalDateTime.of(date, time); }
@Override public InetSocketAddress readObject(ObjectInput input) throws IOException, ClassNotFoundException { InetAddress address = DefaultExternalizer.INET_ADDRESS.cast(InetAddress.class).readObject(input); int port = IndexSerializer.UNSIGNED_SHORT.readInt(input); return (address != null) ? new InetSocketAddress(address, port) : InetSocketAddress.createUnresolved(input.readUTF(), port); }
@Override public InetSocketAddress readObject(ObjectInput input) throws IOException, ClassNotFoundException { InetAddress address = DefaultExternalizer.INET_ADDRESS.cast(InetAddress.class).readObject(input); int port = IndexSerializer.UNSIGNED_SHORT.readInt(input); return (address != null) ? new InetSocketAddress(address, port) : InetSocketAddress.createUnresolved(input.readUTF(), port); }
@Override public YearMonth readObject(ObjectInput input) throws IOException, ClassNotFoundException { int year = input.readInt(); Month month = DefaultExternalizer.MONTH.cast(Month.class).readObject(input); return YearMonth.of(year, month); }
@Override public YearMonth readObject(ObjectInput input) throws IOException, ClassNotFoundException { int year = input.readInt(); Month month = DefaultExternalizer.MONTH.cast(Month.class).readObject(input); return YearMonth.of(year, month); }
@Override public MonthDay readObject(ObjectInput input) throws IOException, ClassNotFoundException { Month month = DefaultExternalizer.MONTH.cast(Month.class).readObject(input); int day = IndexSerializer.UNSIGNED_BYTE.readInt(input); return MonthDay.of(month, day); }