Package com.avsystem.anjay
Class AnjayBytesContext
- java.lang.Object
-
- com.avsystem.anjay.AnjayBytesContext
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class AnjayBytesContext extends java.lang.Object implements java.lang.AutoCloseableBytes context which may be used to return bytes from read handlers inAnjayObject.
-
-
Constructor Summary
Constructors Constructor Description AnjayBytesContext(com.avsystem.anjay.impl.NativeBytesContext context)Creates bytes context - it is not intended to be called by user.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(byte[] array)Appends array of bytes to the context.voidappend(byte[] array, int offset, int length)Appends part of the array of bytes to the context.voidappend(java.nio.ByteBuffer buffer)Appends buffer to the context.voidclose()Closes the context.
-
-
-
Constructor Detail
-
AnjayBytesContext
public AnjayBytesContext(com.avsystem.anjay.impl.NativeBytesContext context)
Creates bytes context - it is not intended to be called by user. UseAnjayOutputContext.retBytes(int)instead.
-
-
Method Detail
-
close
public void close()
Closes the context.- Specified by:
closein interfacejava.lang.AutoCloseable
-
append
public void append(java.nio.ByteBuffer buffer)
Appends buffer to the context.
-
append
public void append(byte[] array, int offset, int length)Appends part of the array of bytes to the context.- Parameters:
array- Array of bytes.offset- Offset inarrayto start reading from.length- Length of the data to append.
-
append
public void append(byte[] array)
Appends array of bytes to the context.- Parameters:
array- Array of bytes to append.
-
-