/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2022 DBeaver Corp and others
*/
package org.jkiss.utils;
import java.io.*;
import java.net.ServerSocket;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;
/**
* Some IO helper functions
*/
public final class IOUtils {
public static final int DEFAULT_BUFFER_SIZE = 16384;
private static final boolean USE_NIO_STREAMS = false;
public static void close(Closeable closeable) {
try {
closeable.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public static void close(AutoCloseable closeable) {
try {
closeable.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void