Package org.h2.util

Class Utils10


  • public final class Utils10
    extends java.lang.Object
    Utilities with specialized implementations for Java 10 and later versions. This class contains basic implementations for Java 8 and 9 and it is overridden in multi-release JARs.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Utils10()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String byteArrayOutputStreamToString​(java.io.ByteArrayOutputStream baos, java.nio.charset.Charset charset)
      Converts the buffer's contents into a string by decoding the bytes using the specified charset.
      static boolean getTcpQuickack​(java.net.Socket socket)
      Returns the value of TCP_QUICKACK option.
      static boolean setTcpQuickack​(java.net.Socket socket, boolean value)
      Sets the value of TCP_QUICKACK option.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Utils10

        private Utils10()
    • Method Detail

      • byteArrayOutputStreamToString

        public static java.lang.String byteArrayOutputStreamToString​(java.io.ByteArrayOutputStream baos,
                                                                     java.nio.charset.Charset charset)
        Converts the buffer's contents into a string by decoding the bytes using the specified charset.
        Parameters:
        baos - the buffer to decode
        charset - the charset to use
        Returns:
        the decoded string
      • getTcpQuickack

        public static boolean getTcpQuickack​(java.net.Socket socket)
                                      throws java.io.IOException
        Returns the value of TCP_QUICKACK option.
        Parameters:
        socket - the socket
        Returns:
        the current value of TCP_QUICKACK option
        Throws:
        java.io.IOException - on I/O exception
        java.lang.UnsupportedOperationException - if TCP_QUICKACK is not supported
      • setTcpQuickack

        public static boolean setTcpQuickack​(java.net.Socket socket,
                                             boolean value)
        Sets the value of TCP_QUICKACK option.
        Parameters:
        socket - the socket
        value - the value to set
        Returns:
        whether operation was successful