Class Blobs


  • public class Blobs
    extends java.lang.Object
    Static methods for Blob.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Blob from​(WritableContents writable, boolean retryable)  
      static Blob from​(JsonTemplate template)  
      static Blob from​(java.io.InputStream inputStream)  
      static Blob from​(java.lang.String content)
      Creates a StringBlob with UTF-8 encoding.
      static Blob from​(java.nio.file.Path file)  
      static byte[] writeToByteArray​(Blob blob)
      Writes the BLOB to a byte array.
      static java.lang.String writeToString​(Blob blob)
      Writes the BLOB to a string with UTF-8 decoding.
      • Methods inherited from class java.lang.Object

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

      • from

        public static Blob from​(java.io.InputStream inputStream)
      • from

        public static Blob from​(java.nio.file.Path file)
      • from

        public static Blob from​(java.lang.String content)
        Creates a StringBlob with UTF-8 encoding.
        Parameters:
        content - the string to create the blob from
        Returns:
        the StringBlob
      • writeToString

        public static java.lang.String writeToString​(Blob blob)
                                              throws java.io.IOException
        Writes the BLOB to a string with UTF-8 decoding.
        Parameters:
        blob - the BLOB to write
        Returns:
        the BLOB contents as a string
        Throws:
        java.io.IOException - if writing out the BLOB contents fails
      • writeToByteArray

        public static byte[] writeToByteArray​(Blob blob)
                                       throws java.io.IOException
        Writes the BLOB to a byte array.
        Parameters:
        blob - the BLOB to write
        Returns:
        the BLOB contents as a byte array
        Throws:
        java.io.IOException - if writing out the BLOB contents fails