Package java.util.zip

Examples of java.util.zip.DataFormatException


        if (inf.finished())
          return dstbuf;
        if (inf.needsInput())
          pos += setInput(pos, inf);
        else if (n == 0)
          throw new DataFormatException();
      }
    }
View Full Code Here


        return dstoff;
      if (inf.needsInput()) {
        pin(pack, position);
        position += window.setInput(position, inf);
      } else if (n == 0)
        throw new DataFormatException();
    }
  }
View Full Code Here

          pin(pack, position);
          position += window.setInput(position, inf);
        } else if (inf.finished())
          return dstoff;
        else
          throw new DataFormatException();
      }
      dstoff += n;
    } while (dstoff < dstbuf.length);
    return dstoff;
  }
View Full Code Here

   */
  private int getInt() throws DataFormatException {
    if (input.hasNextInt()) {
      return input.nextInt();
    } else {
      throw new DataFormatException("This is not a number");
    }

  }
View Full Code Here

            if (inf.finished()) {
                return -1;
            } else if (inf.needsDictionary()) {
                gzipEntry.diagnostics.addError(new Diagnosis(DiagnosisType.INVALID_DATA, "GZip file", "Unexpected EOF!"));
                bIsCompliant = false;
                throw new DataFormatException("Dictionary needed!");
            } else if (inf.needsInput()) {
                lastInput = pbin.read(inputBytes, 0, inputBytes.length);
                if (lastInput == -1) {
                    gzipEntry.diagnostics.addError(new Diagnosis(DiagnosisType.INVALID_DATA, "GZip file", "Unexpected EOF!"));
                    bIsCompliant = false;
                    throw new DataFormatException("Data missing!");
                }
                inf.setInput(inputBytes, 0, lastInput);
            } else {
                gzipEntry.diagnostics.addError(new Diagnosis(DiagnosisType.INVALID_DATA, "GZip file", "Unexpected EOF!"));
                bIsCompliant = false;
                throw new DataFormatException("Inflater malfunction!");
            }
        }
        return inflated;
    }
View Full Code Here

                    crc.update(inputBytes, 0, read);
                } else {
                    def.finish();
                }
            } else {
                throw new DataFormatException("Deflater malfunction!");
            }
        }
        return deflated;
    }
View Full Code Here

                        // Deflater needs more input.
                        return 0;
                    }
                }
            } else {
                throw new DataFormatException("Deflater malfunction!");
            }
        }
        return deflated;
    }
View Full Code Here

   */
  public void addCharacter(Object character) throws DataFormatException {
    if (character instanceof javaEffect.characters.Character) {
      this.character.add(character);
    } else {
      throw new DataFormatException("This is not a character");
    }
  }
View Full Code Here

  public void addSpacecraft(Object spacecraft) throws DataFormatException {

    if (spacecraft instanceof javaEffect.spacecraft.Spacecraft) {
      this.spacecraft.add(spacecraft);
    } else {
      throw new DataFormatException("This is not a Spacecraft");
    }
  }
View Full Code Here

        position += block.remaining(position);
        pin(pack, position);
      } else if (inf.finished())
        return dstoff;
      else
        throw new DataFormatException();
    }
  }
View Full Code Here

TOP

Related Classes of java.util.zip.DataFormatException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.