public byte readByte() { try { return this.dis.readByte(); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
private void executeFutureWithTimeOut(final long maxTime, final FutureTask<?> future, final ResultCollector rc) { try { future.get(maxTime, TimeUnit.MILLISECONDS); } catch (final TimeoutException ex) { // swallow } catch (final InterruptedException e) { // swallow } catch (final ExecutionException e) { throw Unchecked.translateCheckedException(e); } }
public void close() { try { this.dos.close(); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
public void writeByte(final byte b) { try { this.dos.writeByte(b); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
public boolean readBoolean() { try { return this.dis.readBoolean(); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
public void writeLong(final long l) { try { this.dos.writeLong(l); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
private void write(final Writer out, final String value) { try { out.write(value); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
public void writeInt(final int value) { try { this.dos.writeInt(value); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
public long readLong() { try { return this.dis.readLong(); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
private void write(final String value) { try { this.out.write(value); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
public synchronized ServerSocket getNextAvailableServerSocket() { try { return new ServerSocket(0); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
private static void closeQuietly(final ZipFile zip) { try { zip.close(); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
public void writeBoolean(final boolean b) { try { this.dos.writeBoolean(b); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
public static Class<?> convertForClassLoader(final ClassLoader loader, final String name) { try { return Class.forName(name, false, loader); } catch (final ClassNotFoundException ex) { throw translateCheckedException(ex); } }
public int readInt() { try { return this.dis.readInt(); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
public void close() { try { this.dis.close(); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
public byte[] readBytes() { try { final int length = this.dis.readInt(); final byte[] data = new byte[length]; this.dis.readFully(data); return data; } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
private ZipFile getRoot() { try { return new ZipFile(this.file); } catch (final IOException ex) { throw Unchecked.translateCheckedException(ex.getMessage() + " (" + this.file + ")", ex); } }
public void writeBytes(final byte[] data) { try { this.dos.writeInt(data.length); this.dos.write(data); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }
private <T> String serialize(T t) { try { final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); final ObjectOutputStream objectOutputStream = new ObjectOutputStream( byteArrayOutputStream); objectOutputStream.writeObject(t); return Base64.getEncoder().encodeToString(byteArrayOutputStream.toByteArray()); } catch (final IOException e) { throw Unchecked.translateCheckedException(e); } }