Package java.io

Examples of java.io.StreamCorruptedException


   */
  protected Object readResolve() throws ObjectStreamException {
    Object par = allParameters.get(makeKey(name));
   
    if(par == null)
      throw new StreamCorruptedException("Unknown parameter value: " + name);
     
    return par;
  }
View Full Code Here


            case SERIAL_PATH_END:
                if (nT < 0) {
                    break PATHDONE;
                }
                throw new StreamCorruptedException("unexpected PATH_END");

            default:
                throw new StreamCorruptedException("unrecognized path type");
            }
            needRoom(segtype != SEG_MOVETO, npoints * 2);
            if (isdbl) {
                while (--npoints >= 0) {
                    append(s.readDouble(), s.readDouble());
                }
            } else {
                while (--npoints >= 0) {
                    append(s.readFloat(), s.readFloat());
                }
            }
            pointTypes[numTypes++] = segtype;
        }
        if (nT >= 0 && s.readByte() != SERIAL_PATH_END) {
            throw new StreamCorruptedException("missing PATH_END");
        }
    }
View Full Code Here

            if (scFirst) {
                long scIndex = readBuffer.getLong();
//                System.out.println("ri " + scIndex);
                if (scIndex != chronicle.size())
                    throw new StreamCorruptedException("Expected index " + chronicle.size() + " but got " + scIndex);
                scFirst = false;
            }
            long size = readBuffer.getInt();
            if (size == InProcessChronicleSource.IN_SYNC_LEN) {
//                System.out.println("... received inSync");
                return false;
            }

//            System.out.println("size=" + size + "  rb " + readBuffer);
            if (size > 128 << 20 || size < 0)
                throw new StreamCorruptedException("size was " + size);

            excerpt.startExcerpt((int) size);
            // perform a progressive copy of data.
            long remaining = size;
            int limit = readBuffer.limit();
View Full Code Here

                    do {
                        readHeader(sc, bb);
                        long index = bb.getLong(0);
                        long size = bb.getInt(8);
                        if (index != chronicle.size())
                            throw new StreamCorruptedException("Expected index " + chronicle.size() + " but got " + index);
                        if (size > Integer.MAX_VALUE || size < 0)
                            throw new StreamCorruptedException("size was " + size);

                        excerpt.startExcerpt((int) size);
                        // perform a progressive copy of data.
                        long remaining = size;
                        bb.position(0);
View Full Code Here

    }

    public Object readObject() throws ClassNotFoundException, IOException {
        int objectSize = in.readInt();
        if (objectSize <= 0) {
            throw new StreamCorruptedException("Invalid objectSize: "
                    + objectSize);
        }
        if (objectSize > maxObjectSize) {
            throw new StreamCorruptedException("ObjectSize too big: "
                    + objectSize + " (expected: <= " + maxObjectSize + ')');
        }

        ByteBuffer buf = ByteBuffer.allocate(objectSize + 4, false);
        buf.putInt(objectSize);
View Full Code Here

        {
      // We catch this here as it is usuall a user error.
      // they have readExternal (or SQLData) that doesn't match
      // the writeExternal. and thus the object read is of
      // the incorrect type, e.g. Integer i = (Integer) in.readObject();
      throw new StreamCorruptedException(cce.toString());
    }
  }
View Full Code Here

      colArray = ArrayUtil.readIntArray(in);
      raRules = ArrayUtil.readIntArray(in);
    }
    catch (StandardException exception)
    {
      throw new StreamCorruptedException(exception.toString());
    }
  }
View Full Code Here

                        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

    }
    else if ( name.equals( PARTIAL.name ) ) {
      return PARTIAL;
    }
    else {
      throw new StreamCorruptedException( "unrecognized value inclusion [" + name + "]" );
    }
  }
View Full Code Here

            }

            break;
         }
         default:
            throw new StreamCorruptedException("Unkown version seen: " + version);
      }
   }
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.