Class BackportUtils

java.lang.Object
io.confluent.csid.utils.BackportUtils

public class BackportUtils
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    BackportUtils()  
  • Method Summary

    Modifier and Type Method Description
    static boolean isEmpty​(java.util.Optional<?> optional)  
    static byte[] readFully​(java.io.InputStream is)  
    static byte[] readFully​(java.io.InputStream is, int length, boolean readAll)
    Used in Java 8 environments (Java 9 has read all bytes)
    static long toSeconds​(java.time.Duration duration)  

    Methods inherited from class java.lang.Object

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

  • Method Details

    • toSeconds

      public static long toSeconds​(java.time.Duration duration)
      See Also:
      intro'd in Java 9
    • isEmpty

      public static boolean isEmpty​(java.util.Optional<?> optional)
      See Also:
      intro'd java 11
    • readFully

      public static byte[] readFully​(java.io.InputStream is) throws java.io.IOException
      Throws:
      java.io.IOException
    • readFully

      public static byte[] readFully​(java.io.InputStream is, int length, boolean readAll) throws java.io.IOException
      Used in Java 8 environments (Java 9 has read all bytes)

      https://stackoverflow.com/a/25892791/105741

      Throws:
      java.io.IOException