Class Util
- java.lang.Object
-
- com.github.davidmoten.odata.client.internal.Util
-
public final class Util extends Object
-
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopy(InputStream in, OutputStream out, int bufferSize)static <T extends ODataType>
StringodataTypeName(Class<T> cls)static <T> StringodataTypeNameFromAny(Class<T> cls)static byte[]read(InputStream in)static intreadFully(InputStream in, byte[] buffer, int size)Reads size bytes into buffer from InputStream if end of stream not reached.static StringreadString(InputStream in, Charset charset)static StringtrimTrailingSlash(String url)
-
-
-
Method Detail
-
readString
public static String readString(InputStream in, Charset charset) throws IOException
- Throws:
IOException
-
readFully
public static int readFully(InputStream in, byte[] buffer, int size)
Reads size bytes into buffer from InputStream if end of stream not reached. Returns the number of bytes read (which will besizeif end of stream not reached).- Parameters:
in- input streambuffer- destination array to read intosize- number of bytes to read if available- Returns:
- number of bytes read
-
read
public static byte[] read(InputStream in)
-
copy
public static void copy(InputStream in, OutputStream out, int bufferSize) throws IOException
- Throws:
IOException
-
-