Skip to content

Most visited

Recently visited

navigation
Added in API level 1

ObjectOutputStream.PutField

public static abstract class ObjectOutputStream.PutField
extends Object

java.lang.Object
   ↳ java.io.ObjectOutputStream.PutField


PutField is an inner class to provide access to the persistent fields that are written to the target stream.

Summary

Public constructors

ObjectOutputStream.PutField()

Public methods

abstract void put(String name, Object value)

Puts the value of the Object field identified by name to the persistent field.

abstract void put(String name, int value)

Puts the value of the integer field identified by name to the persistent field.

abstract void put(String name, float value)

Puts the value of the float field identified by name to the persistent field.

abstract void put(String name, boolean value)

Puts the value of the boolean field identified by name to the persistent field.

abstract void put(String name, byte value)

Puts the value of the byte field identified by name to the persistent field.

abstract void put(String name, short value)

Puts the value of the short field identified by name to the persistent field.

abstract void put(String name, long value)

Puts the value of the long field identified by name to the persistent field.

abstract void put(String name, char value)

Puts the value of the character field identified by name to the persistent field.

abstract void put(String name, double value)

Puts the value of the double field identified by name to the persistent field.

abstract void write(ObjectOutput out)

This method was deprecated in API level 1. This method is unsafe and may corrupt the target stream. Use ObjectOutputStream#writeFields() instead.

Inherited methods

From class java.lang.Object

Public constructors

ObjectOutputStream.PutField

Added in API level 1
ObjectOutputStream.PutField ()

Public methods

put

Added in API level 1
void put (String name, 
                Object value)

Puts the value of the Object field identified by name to the persistent field.

Parameters
name String: the name of the field to serialize.
value Object: the value that is put to the persistent field.

put

Added in API level 1
void put (String name, 
                int value)

Puts the value of the integer field identified by name to the persistent field.

Parameters
name String: the name of the field to serialize.
value int: the value that is put to the persistent field.

put

Added in API level 1
void put (String name, 
                float value)

Puts the value of the float field identified by name to the persistent field.

Parameters
name String: the name of the field to serialize.
value float: the value that is put to the persistent field.

put

Added in API level 1
void put (String name, 
                boolean value)

Puts the value of the boolean field identified by name to the persistent field.

Parameters
name String: the name of the field to serialize.
value boolean: the value that is put to the persistent field.

put

Added in API level 1
void put (String name, 
                byte value)

Puts the value of the byte field identified by name to the persistent field.

Parameters
name String: the name of the field to serialize.
value byte: the value that is put to the persistent field.

put

Added in API level 1
void put (String name, 
                short value)

Puts the value of the short field identified by name to the persistent field.

Parameters
name String: the name of the field to serialize.
value short: the value that is put to the persistent field.

put

Added in API level 1
void put (String name, 
                long value)

Puts the value of the long field identified by name to the persistent field.

Parameters
name String: the name of the field to serialize.
value long: the value that is put to the persistent field.

put

Added in API level 1
void put (String name, 
                char value)

Puts the value of the character field identified by name to the persistent field.

Parameters
name String: the name of the field to serialize.
value char: the value that is put to the persistent field.

put

Added in API level 1
void put (String name, 
                double value)

Puts the value of the double field identified by name to the persistent field.

Parameters
name String: the name of the field to serialize.
value double: the value that is put to the persistent field.

write

Added in API level 1
void write (ObjectOutput out)

This method was deprecated in API level 1.
This method is unsafe and may corrupt the target stream. Use ObjectOutputStream#writeFields() instead.

Writes the fields to the target stream out.

Parameters
out ObjectOutput: the target stream
Throws
IOException if an error occurs while writing to the target stream.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.