Class SceneformBufferUtils
- java.lang.Object
-
- com.google.ar.sceneform.utilities.SceneformBufferUtils
-
public final class SceneformBufferUtils extends java.lang.Object
A simple class to read InputStreams Once the data is read it can be accessed as a ByteBuffer.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.nio.ByteBuffer
copyByteBuffer(java.nio.ByteBuffer in)
static byte[]
copyByteBufferToArray(java.nio.ByteBuffer in)
static byte[]
inputStreamCallableToByteArray(java.util.concurrent.Callable<java.io.InputStream> inputStreamCreator)
static byte[]
inputStreamToByteArray(java.io.InputStream input)
static java.nio.ByteBuffer
inputStreamToByteBuffer(java.util.concurrent.Callable<java.io.InputStream> inputStreamCreator)
static java.nio.ByteBuffer
readFile(android.content.res.AssetManager assets, java.lang.String path)
static java.nio.ByteBuffer
readStream(java.io.InputStream inputStream)
-
-
-
Method Detail
-
readFile
@Nullable public static java.nio.ByteBuffer readFile(android.content.res.AssetManager assets, java.lang.String path)
-
readStream
@Nullable public static java.nio.ByteBuffer readStream(@Nullable java.io.InputStream inputStream)
-
copyByteBufferToArray
public static byte[] copyByteBufferToArray(java.nio.ByteBuffer in) throws java.io.IOException
- Throws:
java.io.IOException
-
copyByteBuffer
public static java.nio.ByteBuffer copyByteBuffer(java.nio.ByteBuffer in) throws java.io.IOException
- Throws:
java.io.IOException
-
inputStreamToByteBuffer
public static java.nio.ByteBuffer inputStreamToByteBuffer(java.util.concurrent.Callable<java.io.InputStream> inputStreamCreator)
-
inputStreamCallableToByteArray
public static byte[] inputStreamCallableToByteArray(java.util.concurrent.Callable<java.io.InputStream> inputStreamCreator) throws java.lang.Exception
- Throws:
java.lang.Exception
-
inputStreamToByteArray
public static byte[] inputStreamToByteArray(java.io.InputStream input) throws java.io.IOException
- Throws:
java.io.IOException
-
-