#

| Chapter 18 The java.util.zip Package |

# DataFormatException

## Name

DataFormatException

## Synopsis

Class Name:

  `java.util.zip.DataFormatException`

Superclass:

  `java.lang.Exception`

Immediate Subclasses:

  None

Interfaces Implemented:

  None

Availability:

  New as of JDK 1.1

## Description

A `DataFormatException` is thrown when data is not in the expected format, which can mean that the data is invalid or corrupt. In particular, the `inflate()` methods of `Inflater` throw this exception if they encounter data in an unexpected format.

## Class Summary

    public class java.util.zip.DataFormatException
                 extends java.lang.Exception {
      // Constructors
      public DataFormatException();
      public DataFormatException(String s);
    }

## Constructors

### DataFormatException

#### protected DataFormatException()

Description

  This constructor creates a `DataFormatException` with no associated detail message.

#### public DataFormatException(String s)

Parameters

  `s`

    The detail message.

Description

  This constructor creates a `DataFormatException` with the specified detail message.

## 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()` | `Throwable`
`wait()` | `Object` | `wait(long)` | `Object`
`wait(long, int)` | `Object` |  |

## See Also

`Exception`, `Inflater`, `Throwable`

CRC32 |  | Deflater