本文整理了Java中sun.misc.Unsafe.putBoolean()
方法的一些代码示例,展示了Unsafe.putBoolean()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Unsafe.putBoolean()
方法的具体详情如下:
包路径:sun.misc.Unsafe
类名称:Unsafe
方法名:putBoolean
暂无
代码示例来源:origin: neo4j/neo4j
public static void putBoolean( Object obj, long offset, boolean value )
{
unsafe.putBoolean( obj, offset, value );
}
代码示例来源:origin: apache/ignite
/**
* Stores boolean value into byte array.
*
* @param arr Byte array.
* @param off Offset.
* @param val Value.
*/
public static void putBoolean(byte[] arr, long off, boolean val) {
UNSAFE.putBoolean(arr, off, val);
}
代码示例来源:origin: apache/ignite
/**
* Stores boolean value into object field.
*
* @param obj Object.
* @param fieldOff Field offset.
* @param val Value.
*/
public static void putBooleanField(Object obj, long fieldOff, boolean val) {
UNSAFE.putBoolean(obj, fieldOff, val);
}
代码示例来源:origin: redisson/redisson
public final void setBooleanValue(Object newObj, boolean i1) throws IllegalAccessException {
if (!isAndroid && memOffset >= 0) {
FSTUtil.unFlaggedUnsafe.putBoolean(newObj, memOffset, i1);
return;
}
field.setBoolean(newObj, i1);
}
代码示例来源:origin: com.google.protobuf/protobuf-java
@Override
public void putBoolean(Object target, long offset, boolean value) {
unsafe.putBoolean(target, offset, value);
}
代码示例来源:origin: bytedeco/javacpp
@Override void putBoolean(byte[] array, long offset, boolean b) { UNSAFE.putBoolean(array, arrayOffset + offset, b); }
}
代码示例来源:origin: apache/avro
@Override
protected void set(Object object, Object value) {
UNSAFE.putBoolean(object, offset, (Boolean) value);
}
代码示例来源:origin: apache/geode
public void putBoolean(Object o, long offset, boolean v) {
this.unsafe.putBoolean(o, offset, v);
}
代码示例来源:origin: org.apache.avro/avro
@Override
protected void set(Object object, Object value) {
UNSAFE.putBoolean(object, offset, (Boolean) value);
}
代码示例来源:origin: fengjiachun/Jupiter
public void putBoolean(Object target, long offset, boolean value) {
unsafe.putBoolean(target, offset, value);
}
代码示例来源:origin: fengjiachun/Jupiter
public void putBoolean(Object target, long offset, boolean value) {
unsafe.putBoolean(target, offset, value);
}
代码示例来源:origin: RuedigerMoeller/fast-serialization
public final void setBooleanValue(Object newObj, boolean i1) throws IllegalAccessException {
if (!isAndroid && memOffset >= 0) {
FSTUtil.unFlaggedUnsafe.putBoolean(newObj, memOffset, i1);
return;
}
field.setBoolean(newObj, i1);
}
代码示例来源:origin: wildfly/wildfly
/**
* Set the boolean value of this field on the given object instance.
*
* @param instance the object instance (must not be {@code null}, must be of the correct type)
* @param value the value to set
* @throws ClassCastException if {@code instance} or the field is not of the correct type
* @throws IllegalArgumentException if this instance has no reflection field set on it
*/
public void setBoolean(Object instance, boolean value) throws ClassCastException, IllegalArgumentException {
if (instance == null) {
throw new IllegalArgumentException("instance is null");
}
if (field == null) {
throw new IllegalArgumentException();
}
field.getDeclaringClass().cast(instance);
if (field.getType() != boolean.class) {
throw new ClassCastException();
}
unsafe.putBoolean(instance, fieldOffset, value);
}
代码示例来源:origin: apache/avro
@Override
protected void read(Object object, Decoder in) throws IOException {
UNSAFE.putBoolean(object, offset, in.readBoolean());
}
代码示例来源:origin: org.apache.avro/avro
@Override
protected void read(Object object, Decoder in) throws IOException {
UNSAFE.putBoolean(object, offset, in.readBoolean());
}
代码示例来源:origin: wildfly/wildfly
/**
* Set the value of the field to the given value.
*
* @param instance the instance to set
* @param value the new value
* @throws IllegalArgumentException if the given instance is {@code null} or not of the correct class
*/
public void setBoolean(Object instance, boolean value) throws IllegalArgumentException {
if (! clazz.isInstance(instance)) {
throw incorrectType();
}
if (fieldType != boolean.class) {
throw incorrectValueType();
}
unsafe.putBoolean(instance, fieldOffset, value);
}
代码示例来源:origin: com.thoughtworks.xstream/xstream
unsafe.putDouble(object, offset, ((Double)value).doubleValue());
} else if (type.equals(Boolean.TYPE)) {
unsafe.putBoolean(object, offset, ((Boolean)value).booleanValue());
} else {
ObjectAccessException ex = new ObjectAccessException("Cannot set field of unknown type", exception);
代码示例来源:origin: aaberg/sql2o
public void setProperty(Object obj, Object value) {
if (value == null) return;
theUnsafe.putBoolean(obj, offset, (Boolean) value);
}
代码示例来源:origin: webx/citrus
@SuppressWarnings("restriction")
void deserialize(AbstractHessianInput in, Object obj)
throws IOException {
boolean value = false;
try {
value = in.readBoolean();
_unsafe.putBoolean(obj, _offset, value);
} catch (Exception e) {
logDeserializeError(_field, obj, value, e);
}
}
}
代码示例来源:origin: webx/citrus
@SuppressWarnings("restriction")
void deserialize(AbstractHessianInput in, Object obj)
throws IOException {
boolean value = false;
try {
value = in.readBoolean();
_unsafe.putBoolean(obj, _offset, value);
} catch (Exception e) {
logDeserializeError(_field, obj, value, e);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!