[Chapter 11] StreamCorruptedException

#

| Chapter 11 The java.io Package |

# StreamCorruptedException

## Name

StreamCorruptedException

## Synopsis

Class Name:

  `java.io.StreamCorruptedException`

Superclass:

  `java.io.ObjectStreamException`

Immediate Subclasses:

  None

Interfaces Implemented:

  None

Availability:

  New as of JDK 1.1

## Description

A `StreamCorruptedException` is thrown during object deserialization to indicate that the stream being read is corrupted and doesn't contain valid serialized object data.

## Class Summary

    public class java.io.StreamCorruptedException
                 extends java.io.ObjectStreamException {
      // Constructors
      public StreamCorruptedException();
      public StreamCorruptedException(String reason);
    }

## Constructors

### StreamCorruptedException

#### public StreamCorruptedException()

Description

  This constructor creates a `StreamCorruptedException` with no reason string.

#### public StreamCorruptedException(String reason)

Parameters

  `reason`

    A description of the reason this exception was thrown.

Description

  This constructor creates a `StreamCorruptedException` with the specified reason string.

## Inherited Methods

Method | Inherited From | Method | Inherited From
--- | --- | --- | ---
`clone()` | `Object` | `equals(Object)` | `Object`
`fillInStackTrace()` | `Throwable` | `finalize()` | `Object`
`getClass()` | `Object` | `getLocalizedMessage()` | `Throwable`
`getMessage()` | `Throwable` | `hashCode()` | `Object`
`notify()` | `Object` | `notifyAll()` | `Object`
`printStackTrace()` | `Throwable` | `printStackTrace(PrintStream)` | `Throwable`
`printStackTrace(PrintWriter)` | `Throwable` | `toString()` | `Object`
`wait()` | `Object` | `wait(long)` | `Object`
`wait(long, int)` | `Object` |  |

## See Also

`Exception`, `ObjectStreamException`, `Throwable`

Serializable |  | StreamTokenizer