Added in API level 1

PutField

abstract class PutField
kotlin.Any
   ↳ java.io.ObjectOutputStream.PutField

Provide programmatic access to the persistent fields to be written to ObjectOutput.

Summary

Public constructors

Public methods
abstract Unit
put(name: String!, val: Boolean)

Put the value of the named boolean field into the persistent field.

abstract Unit
put(name: String!, val: Byte)

Put the value of the named byte field into the persistent field.

abstract Unit
put(name: String!, val: Char)

Put the value of the named char field into the persistent field.

abstract Unit
put(name: String!, val: Double)

Put the value of the named double field into the persistent field.

abstract Unit
put(name: String!, val: Float)

Put the value of the named float field into the persistent field.

abstract Unit
put(name: String!, val: Int)

Put the value of the named int field into the persistent field.

abstract Unit
put(name: String!, val: Any!)

Put the value of the named Object field into the persistent field.

abstract Unit
put(name: String!, val: Long)

Put the value of the named long field into the persistent field.

abstract Unit
put(name: String!, val: Short)

Put the value of the named short field into the persistent field.

abstract Unit

Write the data and fields to the specified ObjectOutput stream, which must be the same stream that produced this PutField object.

Public constructors

PutField

Added in API level 1
PutField()

Public methods

put

Added in API level 1
abstract fun put(
    name: String!,
    val: Boolean
): Unit

Put the value of the named boolean field into the persistent field.

Parameters
name String!: the name of the serializable field
val Boolean: the value to assign to the field
Exceptions
java.lang.IllegalArgumentException if name does not match the name of a serializable field for the class whose fields are being written, or if the type of the named field is not boolean

put

Added in API level 1
abstract fun put(
    name: String!,
    val: Byte
): Unit

Put the value of the named byte field into the persistent field.

Parameters
name String!: the name of the serializable field
val Byte: the value to assign to the field
Exceptions
java.lang.IllegalArgumentException if name does not match the name of a serializable field for the class whose fields are being written, or if the type of the named field is not byte

put

Added in API level 1
abstract fun put(
    name: String!,
    val: Char
): Unit

Put the value of the named char field into the persistent field.

Parameters
name String!: the name of the serializable field
val Char: the value to assign to the field
Exceptions
java.lang.IllegalArgumentException if name does not match the name of a serializable field for the class whose fields are being written, or if the type of the named field is not char

put

Added in API level 1
abstract fun put(
    name: String!,
    val: Double
): Unit

Put the value of the named double field into the persistent field.

Parameters
name String!: the name of the serializable field
val Double: the value to assign to the field
Exceptions
java.lang.IllegalArgumentException if name does not match the name of a serializable field for the class whose fields are being written, or if the type of the named field is not double

put

Added in API level 1
abstract fun put(
    name: String!,
    val: Float
): Unit

Put the value of the named float field into the persistent field.

Parameters
name String!: the name of the serializable field
val Float: the value to assign to the field
Exceptions
java.lang.IllegalArgumentException if name does not match the name of a serializable field for the class whose fields are being written, or if the type of the named field is not float

put

Added in API level 1
abstract fun put(
    name: String!,
    val: Int
): Unit

Put the value of the named int field into the persistent field.

Parameters
name String!: the name of the serializable field
val Int: the value to assign to the field
Exceptions
java.lang.IllegalArgumentException if name does not match the name of a serializable field for the class whose fields are being written, or if the type of the named field is not int

put

Added in API level 1
abstract fun put(
    name: String!,
    val: Any!
): Unit

Put the value of the named Object field into the persistent field.

Parameters
name String!: the name of the serializable field
val Any!: the value to assign to the field (which may be null)
Exceptions
java.lang.IllegalArgumentException if name does not match the name of a serializable field for the class whose fields are being written, or if the type of the named field is not a reference type

put

Added in API level 1
abstract fun put(
    name: String!,
    val: Long
): Unit

Put the value of the named long field into the persistent field.

Parameters
name String!: the name of the serializable field
val Long: the value to assign to the field
Exceptions
java.lang.IllegalArgumentException if name does not match the name of a serializable field for the class whose fields are being written, or if the type of the named field is not long

put

Added in API level 1
abstract fun put(
    name: String!,
    val: Short
): Unit

Put the value of the named short field into the persistent field.

Parameters
name String!: the name of the serializable field
val Short: the value to assign to the field
Exceptions
java.lang.IllegalArgumentException if name does not match the name of a serializable field for the class whose fields are being written, or if the type of the named field is not short

write

Added in API level 1
Deprecated in API level 15
abstract fun write(out: ObjectOutput!): Unit

Deprecated: This method does not write the values contained by this PutField object in a proper format, and may result in corruption of the serialization stream. The correct way to write PutField data is by calling the java.io.ObjectOutputStream#writeFields() method.

Write the data and fields to the specified ObjectOutput stream, which must be the same stream that produced this PutField object.

Parameters
out ObjectOutput!: the stream to write the data and fields to
Exceptions
java.io.IOException if I/O errors occur while writing to the underlying stream
java.lang.IllegalArgumentException if the specified stream is not the same stream that produced this PutField object