MCPcopy Create free account
hub / github.com/ReadyTalk/avian / field

Method field

classpath/java/io/ObjectInputStream.java:257–285  ·  view source on GitHub ↗
(Field field, Object o)

Source from the content-addressed store, hash-verified

255 }
256
257 private void field(Field field, Object o)
258 throws IOException, IllegalArgumentException, IllegalAccessException,
259 ClassNotFoundException
260 {
261 Class type = field.getType();
262 if (!type.isPrimitive()) {
263 field.set(o, readObject());
264 } else {
265 if (type == Byte.TYPE) {
266 field.setByte(o, (byte)rawByte());
267 } else if (type == Character.TYPE) {
268 field.setChar(o, (char)rawShort());
269 } else if (type == Double.TYPE) {
270 field.setDouble(o, Double.longBitsToDouble(rawLong()));
271 } else if (type == Float.TYPE) {
272 field.setFloat(o, Float.intBitsToFloat(rawInt()));
273 } else if (type == Integer.TYPE) {
274 field.setInt(o, rawInt());
275 } else if (type == Long.TYPE) {
276 field.setLong(o, rawLong());
277 } else if (type == Short.TYPE) {
278 field.setShort(o, (short)rawShort());
279 } else if (type == Boolean.TYPE) {
280 field.setBoolean(o, rawByte() != 0);
281 } else {
282 throw new IOException("Unhandled type: " + type);
283 }
284 }
285 }
286
287 public Object readObject() throws IOException, ClassNotFoundException {
288 int c = rawByte();

Callers 1

defaultReadObjectMethod · 0.95

Calls 15

isPrimitiveMethod · 0.95
readObjectMethod · 0.95
rawByteMethod · 0.95
rawShortMethod · 0.95
longBitsToDoubleMethod · 0.95
rawLongMethod · 0.95
intBitsToFloatMethod · 0.95
rawIntMethod · 0.95
getTypeMethod · 0.80
setByteMethod · 0.80
setCharMethod · 0.80
setDoubleMethod · 0.80

Tested by

no test coverage detected