Package java.io

Examples of java.io.StreamCorruptedException


    public Class<?> resolveClass(final Unmarshaller unmarshaller, final String name, final long serialVersionUID) throws IOException, ClassNotFoundException {
        final Class<?> clazz = loadClass(name);
        if (enforceSerialVersionUid) {
            final long uid = registry.lookup(clazz).getEffectiveSerialVersionUID();
            if (uid != serialVersionUID) {
                throw new StreamCorruptedException("serialVersionUID does not match!");
            }
        }
        return clazz;
    }
View Full Code Here


                case INT_TYPE:     return   Integer.TYPE;
                case LONG_TYPE:    return      Long.TYPE;
                case SHORT_TYPE:   return     Short.TYPE;
                default:
                    // something's gone wrong
                    throw new StreamCorruptedException(
                        "Invalid primitive type. "
                        + "Check version of beanutils used to serialize is compatible.");

            }
             
View Full Code Here

      int r = channel.read(dst);

      if (r < 0)
         throw new EOFException();
      if (r < dst.capacity() && r > 0)
         throw new StreamCorruptedException("Unexpected EOF in middle of data block.");
   }
View Full Code Here

      int r = channel.read(dst);

      if (r < 0)
         throw new EOFException();
      if (r < dst.capacity() && r > 0)
         throw new StreamCorruptedException("Unexpected EOF in middle of data block.");
   }
View Full Code Here

    @Override
    public int read(final byte[] buf, final int off, final int len) throws IOException {
        final byte[] b = (byte[])peekCallback().readFromStream();
        if (b.length != len) {
            throw new StreamCorruptedException("Expected " + len + " bytes from stream, got " + b.length);
        }
        System.arraycopy(b, 0, buf, off, len);
        return len;
    }
View Full Code Here

                    case 1: // Non-primitive types
                        String className = readUTF();
                        Class<?> clazz = Class.forName(className, true, classLoader);
                        return ObjectStreamClass.lookup(clazz);
                    default:
                        throw new StreamCorruptedException("Unexpected class descriptor type: " + type);
                    }
                }


                @Override
View Full Code Here

         ObjectInputStream.GetField getField = ois.readFields();
         roleName = (String) getField.get("myRoleName", null);
         roleValue = (List) getField.get("myRoleValue", null);
         problemType = getField.get("myPbType", -1);
         if (problemType == -1)
            throw new StreamCorruptedException("No problem type?");
         break;
      default:
         ois.defaultReadObject();
      }
   }
View Full Code Here

         ObjectInputStream.GetField getField = ois.readFields();
         try
         {
            String name = (String) getField.get("canonicalName", null);
            if (name == null)
               throw new StreamCorruptedException("No canonical name for jmx1.0?");
            init(name);
         }
         catch (MalformedObjectNameException e)
         {
            throw new StreamCorruptedException(e.toString());
         }
         break;
      default:
         try
         {
            init((String) ois.readObject());
         }
         catch (MalformedObjectNameException e)
         {
            throw new StreamCorruptedException(e.toString());
         }
      }
   }
View Full Code Here

      {
         init(className, typeName, description);
      }
      catch (Exception e)
      {
         throw new StreamCorruptedException(e.toString());
      }
   }
View Full Code Here

      {
         init(compositeType, contents);
      }
      catch (Exception e)
      {
         throw new StreamCorruptedException(e.toString());
      }
   }
View Full Code Here

TOP

Related Classes of java.io.StreamCorruptedException

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.