Top Description Fields Constructors Methods
jnr.ffi.provider.converters

public Class CharSequenceParameterConverter

extends Object
implements ToNativeConverter<CharSequence, ByteBuffer>
Class Inheritance
All Implemented Interfaces
jnr.ffi.mapper.ToNativeConverter
Annotations
@NoContext
@Cacheable
Imports
jnr.ffi.annotations.Encoding, .In, .NulTerminate, jnr.ffi.mapper.MethodParameterContext, .ToNativeContext, .ToNativeConverter, java.lang.annotation.Annotation, java.lang.ref.Reference, java.nio.ByteBuffer, .CharBuffer, java.nio.charset.Charset, .CharsetEncoder, .CoderResult, java.util.Arrays, .Collection

Converts a CharSequence (e.g. String) to a primitive ByteBuffer array parameter

Field Summary

Modifier and TypeField and Description
private final Charset
private static final ToNativeConverter<CharSequence, ByteBuffer>
private final ThreadLocal<Reference<CharsetEncoder>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static Charset
public static ToNativeConverter<CharSequence, ByteBuffer>
getInstance(Charset charset, ToNativeContext toNativeContext)

public static ToNativeConverter<CharSequence, ByteBuffer>
getInstance(ToNativeContext toNativeContext)

private static ByteBuffer
grow(ByteBuffer oldBuffer)

public Class<ByteBuffer>
public ByteBuffer
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

charsetback to summary
private final Charset charset
DEFAULTback to summary
private static final ToNativeConverter<CharSequence, ByteBuffer> DEFAULT
localEncoderback to summary
private final ThreadLocal<Reference<CharsetEncoder>> localEncoder

Constructor Detail

CharSequenceParameterConverterback to summary
private CharSequenceParameterConverter(Charset charset)

Method Detail

getEncodingCharsetback to summary
private static Charset getEncodingCharset(Collection<Annotation> annotations)
getInstanceback to summary
public static ToNativeConverter<CharSequence, ByteBuffer> getInstance(Charset charset, ToNativeContext toNativeContext)
getInstanceback to summary
public static ToNativeConverter<CharSequence, ByteBuffer> getInstance(ToNativeContext toNativeContext)
growback to summary
private static ByteBuffer grow(ByteBuffer oldBuffer)
nativeTypeback to summary
public Class<ByteBuffer> nativeType()

Implements jnr.ffi.mapper.ToNativeConverter.nativeType.

Annotations
@Override
@In
@NulTerminate
toNativeback to summary
public ByteBuffer toNative(CharSequence string, ToNativeContext context)

Implements jnr.ffi.mapper.ToNativeConverter.toNative.

Annotations
@Override