Package com.avsystem.anjay
Class AnjayInputContext
- java.lang.Object
-
- com.avsystem.anjay.AnjayInputContext
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class AnjayInputContext extends java.lang.Object implements java.lang.AutoCloseableContext from which values sent by LwM2M Server can be read.
-
-
Constructor Summary
Constructors Constructor Description AnjayInputContext(com.avsystem.anjay.impl.NativeInputContextPointer pointer)Creates input context - it is not intended to be called by user.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the context - it is not intended to be called by user.byte[]getAllBytes()Reads all bytes from the RPC request content.booleangetBoolean()Reads a boolean value from the RPC request content.booleangetBytes(java.nio.ByteBuffer out)Reads bytes chunk from the RPC request content.doublegetDouble()Reads a double value from the RPC request content.floatgetFloat()Reads a float value from the RPC request content.intgetInt()Reads an integer from the RPC request content.longgetLong()Reads a long integer from the RPC request content.Anjay.ObjlnkgetObjlnk()Reads an Object Link value from the RPC request content.java.lang.StringgetString()Reads a string from the RPC request content.
-
-
-
Method Detail
-
close
public void close()
Closes the context - it is not intended to be called by user.- Specified by:
closein interfacejava.lang.AutoCloseable
-
getInt
public int getInt() throws AnjayExceptionReads an integer from the RPC request content.- Returns:
- Value read.
- Throws:
AnjayException- In case of failure.
-
getLong
public long getLong() throws AnjayExceptionReads a long integer from the RPC request content.- Returns:
- Value read.
- Throws:
AnjayException- In case of failure.
-
getFloat
public float getFloat() throws AnjayExceptionReads a float value from the RPC request content.- Returns:
- Value read.
- Throws:
AnjayException- In case of failure.
-
getDouble
public double getDouble() throws AnjayExceptionReads a double value from the RPC request content.- Returns:
- Value read.
- Throws:
AnjayException- In case of failure.
-
getBoolean
public boolean getBoolean() throws AnjayExceptionReads a boolean value from the RPC request content.- Returns:
- Value read.
- Throws:
AnjayException- In case of failure.
-
getString
public java.lang.String getString() throws AnjayExceptionReads a string from the RPC request content.- Returns:
- Value read.
- Throws:
AnjayException- In case of failure.
-
getObjlnk
public Anjay.Objlnk getObjlnk() throws AnjayException
Reads an Object Link value from the RPC request content.- Returns:
- Value read.
- Throws:
AnjayException- In case of failure.
-
getBytes
public boolean getBytes(java.nio.ByteBuffer out) throws AnjayExceptionReads bytes chunk from the RPC request content. This function should be called until it returnstrueto read all bytes.- Parameters:
out- Buffer to read bytes to.- Returns:
trueif all bytes have been read, false otherwise.- Throws:
AnjayException- In case of failure.
-
getAllBytes
public byte[] getAllBytes() throws AnjayExceptionReads all bytes from the RPC request content.- Returns:
- Array of bytes.
- Throws:
AnjayException- In case of failure.
-
-