Package com.oracle.cloud.spring.storage
Interface StorageObjectConverter
- All Known Implementing Classes:
JacksonJSONStorageObjectConverter
public interface StorageObjectConverter
Interface to convert Java POJOs to byte array stored on OCI storage service and InputStream of an object to Java POJO.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the storage content type.<T> T
read
(InputStream is, Class<T> clazz) Reads InputStream and creates a Java POJO instance of the class T.<T> byte[]
write
(T object) Converts a Java POJO to byte array.
-
Method Details
-
write
<T> byte[] write(T object) Converts a Java POJO to byte array.- Type Parameters:
T
- Type of the Java POJO- Parameters:
object
- Java POJO- Returns:
- byte[]
-
read
Reads InputStream and creates a Java POJO instance of the class T.- Type Parameters:
T
- Type of the Java POJO- Parameters:
is
- InputStream to read data from.clazz
- Class instance of the type of Java POJO- Returns:
- Instance of Java POJO
-
contentType
String contentType()Returns the storage content type.- Returns:
- String
-