Produced by Siminov Software Solution LLP

siminov.orm.utils
Class Utils

java.lang.Object
  extended by siminov.orm.utils.Utils

public class Utils
extends java.lang.Object

Exposes utility methods which can be used by both SIMINOV/Application.


Constructor Summary
Utils()
           
 
Method Summary
static java.lang.Long generateUniqueId()
          Get generated unique id.
static boolean hasCoverage()
          Check whether device have network coverage or not.
static boolean isEmulator()
          Check whether application is running on emulator or not.
static java.io.InputStream toInputStream(byte[] bytes)
          Get input stream from string.
static java.io.InputStream toInputStream(java.lang.String string)
          Get input stream from string.
static java.lang.String toString(java.io.InputStream inputStream)
          Get string from input stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

toString

public static java.lang.String toString(java.io.InputStream inputStream)
                                 throws SiminovException
Get string from input stream.

Parameters:
inputStream - Input Stream.
Returns:
String
Throws:
SiminovException - If any exception occur while getting string from input stream.

toInputStream

public static java.io.InputStream toInputStream(java.lang.String string)
                                         throws SiminovException
Get input stream from string.

Parameters:
string - String.
Returns:
Input Stream.
Throws:
SiminovException - If any exception occur while getting input stream from string.

toInputStream

public static java.io.InputStream toInputStream(byte[] bytes)
                                         throws SiminovException
Get input stream from string.

Parameters:
bytes - Byte Array.
Returns:
Input Stream.
Throws:
SiminovException - If any exception occur while getting input stream from byte array.

generateUniqueId

public static java.lang.Long generateUniqueId()
Get generated unique id.

Returns:
Long Unique Id.

isEmulator

public static boolean isEmulator()
Check whether application is running on emulator or not.

Returns:
TRUE: If application is running on emulator, FALSE: If application is not running on emulator.

hasCoverage

public static boolean hasCoverage()
Check whether device have network coverage or not.

Returns:
TRUE: If network coverage if there, FALSE: If network coverage is not there.

Apache License 2.0

Copyright 2013