java.io.ObjectInput#readByte ( )源码实例Demo

下面列出了java.io.ObjectInput#readByte ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: database   文件: DefaultLeafCoder.java
@Override
public void readExternal(final ObjectInput in) throws IOException,
        ClassNotFoundException {

    final byte version = in.readByte();
    switch(version) {
    case VERSION0:
        break;
    default:
        throw new IOException();
    }

    keysCoder = (IRabaCoder) in.readObject();
    
    valsCoder = (IRabaCoder) in.readObject();
    
}
 
源代码2 项目: tomee   文件: EJBResponse.java
@Override
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {

    final byte version = in.readByte();

    final boolean readServer = in.readBoolean();
    if (readServer) {
        server = new ServerMetaData();
        server.setMetaData(metaData);
        server.readExternal(in);
    }

    responseCode = in.readByte();

    result = in.readObject();

    if (version >= 2) {

        final byte size = in.readByte();

        for (int i = 0; (i < size && i < timesLength); i++) {
            times[i] = in.readLong();
        }
    }
}
 
源代码3 项目: gemfirexd-oss   文件: JSQLType.java
/**
  @see java.io.Externalizable#readExternal
  @exception IOException thrown on error
  @exception ClassNotFoundException	thrown on error
  */
public void readExternal( ObjectInput in )
	 throws IOException, ClassNotFoundException
{
	byte	frozenCategory = in.readByte();

	switch ( frozenCategory )
	{
	    case SQLTYPE:

			initialize( (DataTypeDescriptor) in.readObject() );
			break;

	    case JAVA_CLASS:

			initialize( (String) in.readObject() );
			break;

	    case JAVA_PRIMITIVE:

			initialize( in.readByte() );
			break;
	}
}
 
源代码4 项目: database   文件: Term2IdTupleSerializer.java
@Override
public void readExternal(final ObjectInput in) throws IOException,
        ClassNotFoundException {

    super.readExternal(in);
    
    final byte version = in.readByte();
    
    switch (version) {
    case VERSION0:
        break;
    default:
        throw new UnsupportedOperationException("Unknown version: "
                + version);
    }

}
 
源代码5 项目: keycloak   文件: InitializerState.java
@Override
public InitializerState readObject(ObjectInput input) throws IOException, ClassNotFoundException {
    switch (input.readByte()) {
        case VERSION_1:
            return readObjectVersion1(input);
        default:
            throw new IOException("Unknown version");
    }
}
 
源代码6 项目: Time4A   文件: ThaiSolarCalendar.java
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {

    byte header = in.readByte();

    switch (header) {
        case THAI_SOLAR:
            this.obj = this.readThaiSolar(in);
            break;
        default:
            throw new InvalidObjectException("Unknown calendar type.");
    }

}
 
源代码7 项目: unitime   文件: XIndividualReservation.java
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   	super.readExternal(in);
   	
   	int nrStudents = in.readInt();
   	iStudentIds.clear();
   	for (int i = 0; i < nrStudents; i++)
   		iStudentIds.add(in.readLong());

   	iLimit = in.readInt();
   	if (iLimit == -2) iLimit = null;
   	
   	if (getType() == XReservationType.IndividualOverride) {
   		switch (in.readByte()) {
   		case 0:
   			iExpired = false; break;
   		case 1:
   			iExpired = true; break;
   		default:
   			iExpired = null; break;
   		}
   		iOverride = in.readBoolean();
   	} else {
   		iExpired = null;
   		iOverride = false;
   	}
	switch (in.readByte()) {
	case 0:
		iBreakLinkedSections = false; break;
	case 1:
		iBreakLinkedSections = true; break;
	default:
		iBreakLinkedSections = null; break;
	}
}
 
源代码8 项目: keycloak   文件: AuthenticationSessionEntity.java
@Override
public AuthenticationSessionEntity readObject(ObjectInput input) throws IOException, ClassNotFoundException {
    switch (input.readByte()) {
        case VERSION_1:
            return readObjectVersion1(input);
        default:
            throw new IOException("Unknown version");
    }
}
 
源代码9 项目: keycloak   文件: PolicyRemovedEvent.java
@Override
public PolicyRemovedEvent readObject(ObjectInput input) throws IOException, ClassNotFoundException {
    switch (input.readByte()) {
        case VERSION_1:
            return readObjectVersion1(input);
        default:
            throw new IOException("Unknown version");
    }
}
 
@Override
public RootAuthenticationSessionPredicate readObject(ObjectInput input) throws IOException, ClassNotFoundException {
    switch (input.readByte()) {
        case VERSION_1:
            return readObjectVersion1(input);
        default:
            throw new IOException("Unknown version");
    }
}
 
源代码11 项目: tomee   文件: ServerMetaData.java
@Override
public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
    final byte version = in.readByte();

    locations = (URI[]) in.readObject();
    location = locations[0];
}
 
源代码12 项目: Time4A   文件: SPX.java
/**
 * <p>Implementation method of interface {@link Externalizable}. </p>
 *
 * @param   in      input stream
 * @throws  IOException in any case of IO-failures
 * @throws  ClassNotFoundException if class loading fails
 */
/*[deutsch]
 * <p>Implementierungsmethode des Interface {@link Externalizable}. </p>
 *
 * @param   in      input stream
 * @throws  IOException in any case of IO-failures
 * @throws  ClassNotFoundException if class loading fails
 */
@Override
public void readExternal(ObjectInput in)
    throws IOException, ClassNotFoundException {

    byte header = in.readByte();

    switch ((header & 0xFF) >> 4) {
        case FALLBACK_TIMEZONE_TYPE:
            this.obj = this.readFallback(in, header);
            break;
        case TRANSITION_RESOLVER_TYPE:
            this.obj = this.readStrategy(header);
            break;
        case HISTORIZED_TIMEZONE_TYPE:
            this.obj = this.readZone(in, header);
            break;
        case ZONAL_OFFSET_TYPE:
            this.obj = this.readOffset(in, header);
            break;
        default:
            throw new StreamCorruptedException("Unknown serialized type.");
    }

}
 
源代码13 项目: reladomo   文件: MultiThreadedTx.java
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
{
    int len = in.readByte();
    this.globalId = new byte[len];
    in.readFully(this.globalId);
    len = in.readByte();
    this.branchId = new byte[len];
    in.readFully(this.branchId);
}
 
源代码14 项目: Time4A   文件: SPX.java
/**
 * <p>Implementation method of interface {@link Externalizable}. </p>
 *
 * @param   in      input stream
 * @throws  IOException in any case of IO-failures
 * @throws  ClassNotFoundException if class-loading fails
 */
/*[deutsch]
 * <p>Implementierungsmethode des Interface {@link Externalizable}. </p>
 *
 * @param   in      input stream
 * @throws  IOException in any case of IO-failures
 * @throws  ClassNotFoundException if class-loading fails
 */
@Override
public void readExternal(ObjectInput in)
    throws IOException, ClassNotFoundException {

    byte header = in.readByte();

    switch ((header & 0xFF) >> 4) {
        case DATE_TYPE:
            this.obj = this.readDate(in, header);
            break;
        case TIME_TYPE:
            this.obj = this.readTime(in);
            break;
        case WEEKMODEL_TYPE:
            this.obj = this.readWeekmodel(in, header);
            break;
        case MOMENT_TYPE:
            this.obj = this.readMoment(in, header);
            break;
        case MACHINE_TIME_TYPE:
            this.obj = this.readMachineTime(in, header);
            break;
        case DURATION_TYPE:
            this.obj = this.readDuration(in, header);
            break;
        case DAY_PERIOD_TYPE:
            this.obj = this.readDayPeriod(in, header);
            break;
        case TIMESTAMP_TYPE:
            this.obj = this.readTimestamp(in, header);
            break;
        default:
            throw new StreamCorruptedException("Unknown serialized type.");
    }

}
 
源代码15 项目: mapleLemon   文件: CharacterIdChannelPair.java
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    this.charid = in.readInt();
    this.channel = in.readByte();
}
 
源代码16 项目: hottub   文件: Ser.java
static Object read(ObjectInput in) throws IOException, ClassNotFoundException {
    byte type = in.readByte();
    return readInternal(type, in);
}
 
源代码17 项目: desugar_jdk_libs   文件: Ser.java
/**
 * Implements the {@code Externalizable} interface to read the object.
 * @serialData
 * The streamed type and parameters defined by the type's {@code writeReplace}
 * method are read and passed to the corresponding static factory for the type
 * to create a new instance.  That instance is returned as the de-serialized
 * {@code Ser} object.
 *
 * <ul>
 * <li><a href="../../../serialized-form.html#java.time.zone.ZoneRules">ZoneRules</a>
 * - {@code ZoneRules.of(standardTransitions, standardOffsets, savingsInstantTransitions, wallOffsets, lastRules);}
 * <li><a href="../../../serialized-form.html#java.time.zone.ZoneOffsetTransition">ZoneOffsetTransition</a>
 * - {@code ZoneOffsetTransition of(LocalDateTime.ofEpochSecond(epochSecond), offsetBefore, offsetAfter);}
 * <li><a href="../../../serialized-form.html#java.time.zone.ZoneOffsetTransitionRule">ZoneOffsetTransitionRule</a>
 * - {@code ZoneOffsetTransitionRule.of(month, dom, dow, time, timeEndOfDay, timeDefinition, standardOffset, offsetBefore, offsetAfter);}
 * </ul>
 * @param in  the data to read, not null
 */
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    type = in.readByte();
    object = readInternal(type, in);
}
 
源代码18 项目: openjdk-jdk9   文件: Ser.java
/**
 * Implements the {@code Externalizable} interface to read the object.
 * @serialData
 *
 * The streamed type and parameters defined by the type's {@code writeReplace}
 * method are read and passed to the corresponding static factory for the type
 * to create a new instance.  That instance is returned as the de-serialized
 * {@code Ser} object.
 *
 * <ul>
 * <li><a href="../../serialized-form.html#java.time.Duration">Duration</a> - {@code Duration.ofSeconds(seconds, nanos);}
 * <li><a href="../../serialized-form.html#java.time.Instant">Instant</a> - {@code Instant.ofEpochSecond(seconds, nanos);}
 * <li><a href="../../serialized-form.html#java.time.LocalDate">LocalDate</a> - {@code LocalDate.of(year, month, day);}
 * <li><a href="../../serialized-form.html#java.time.LocalDateTime">LocalDateTime</a> - {@code LocalDateTime.of(date, time);}
 * <li><a href="../../serialized-form.html#java.time.LocalTime">LocalTime</a> - {@code LocalTime.of(hour, minute, second, nano);}
 * <li><a href="../../serialized-form.html#java.time.MonthDay">MonthDay</a> - {@code MonthDay.of(month, day);}
 * <li><a href="../../serialized-form.html#java.time.OffsetTime">OffsetTime</a> - {@code OffsetTime.of(time, offset);}
 * <li><a href="../../serialized-form.html#java.time.OffsetDateTime">OffsetDateTime</a> - {@code OffsetDateTime.of(dateTime, offset);}
 * <li><a href="../../serialized-form.html#java.time.Period">Period</a> - {@code Period.of(years, months, days);}
 * <li><a href="../../serialized-form.html#java.time.Year">Year</a> - {@code Year.of(year);}
 * <li><a href="../../serialized-form.html#java.time.YearMonth">YearMonth</a> - {@code YearMonth.of(year, month);}
 * <li><a href="../../serialized-form.html#java.time.ZonedDateTime">ZonedDateTime</a> - {@code ZonedDateTime.ofLenient(dateTime, offset, zone);}
 * <li><a href="../../serialized-form.html#java.time.ZoneId">ZoneId</a> - {@code ZoneId.of(id);}
 * <li><a href="../../serialized-form.html#java.time.ZoneOffset">ZoneOffset</a> - {@code (offsetByte == 127 ? ZoneOffset.ofTotalSeconds(in.readInt()) : ZoneOffset.ofTotalSeconds(offsetByte * 900));}
 * </ul>
 *
 * @param in  the data to read, not null
 */
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    type = in.readByte();
    object = readInternal(type, in);
}
 
源代码19 项目: jdk8u-dev-jdk   文件: Ser.java
/**
 * Implements the {@code Externalizable} interface to read the object.
 * @serialData
 *
 * The streamed type and parameters defined by the type's {@code writeReplace}
 * method are read and passed to the corresponding static factory for the type
 * to create a new instance.  That instance is returned as the de-serialized
 * {@code Ser} object.
 *
 * <ul>
 * <li><a href="../../serialized-form.html#java.time.Duration">Duration</a> - {@code Duration.ofSeconds(seconds, nanos);}
 * <li><a href="../../serialized-form.html#java.time.Instant">Instant</a> - {@code Instant.ofEpochSecond(seconds, nanos);}
 * <li><a href="../../serialized-form.html#java.time.LocalDate">LocalDate</a> - {@code LocalDate.of(year, month, day);}
 * <li><a href="../../serialized-form.html#java.time.LocalDateTime">LocalDateTime</a> - {@code LocalDateTime.of(date, time);}
 * <li><a href="../../serialized-form.html#java.time.LocalTime">LocalTime</a> - {@code LocalTime.of(hour, minute, second, nano);}
 * <li><a href="../../serialized-form.html#java.time.MonthDay">MonthDay</a> - {@code MonthDay.of(month, day);}
 * <li><a href="../../serialized-form.html#java.time.OffsetTime">OffsetTime</a> - {@code OffsetTime.of(time, offset);}
 * <li><a href="../../serialized-form.html#java.time.OffsetDateTime">OffsetDateTime</a> - {@code OffsetDateTime.of(dateTime, offset);}
 * <li><a href="../../serialized-form.html#java.time.Period">Period</a> - {@code Period.of(years, months, days);}
 * <li><a href="../../serialized-form.html#java.time.Year">Year</a> - {@code Year.of(year);}
 * <li><a href="../../serialized-form.html#java.time.YearMonth">YearMonth</a> - {@code YearMonth.of(year, month);}
 * <li><a href="../../serialized-form.html#java.time.ZonedDateTime">ZonedDateTime</a> - {@code ZonedDateTime.ofLenient(dateTime, offset, zone);}
 * <li><a href="../../serialized-form.html#java.time.ZoneId">ZoneId</a> - {@code ZoneId.of(id);}
 * <li><a href="../../serialized-form.html#java.time.ZoneOffset">ZoneOffset</a> - {@code (offsetByte == 127 ? ZoneOffset.ofTotalSeconds(in.readInt()) : ZoneOffset.ofTotalSeconds(offsetByte * 900));}
 * </ul>
 *
 * @param in  the data to read, not null
 */
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    type = in.readByte();
    object = readInternal(type, in);
}
 
源代码20 项目: desugar_jdk_libs   文件: Ser.java
/**
 * Implements the {@code Externalizable} interface to read the object.
 * @serialData
 * The streamed type and parameters defined by the type's {@code writeReplace}
 * method are read and passed to the corresponding static factory for the type
 * to create a new instance.  That instance is returned as the de-serialized
 * {@code Ser} object.
 *
 * <ul>
 * <li><a href="../../../serialized-form.html#java.time.chrono.HijrahChronology">HijrahChronology</a> - Chronology.of(id)
 * <li><a href="../../../serialized-form.html#java.time.chrono.IsoChronology">IsoChronology</a> - Chronology.of(id)
 * <li><a href="../../../serialized-form.html#java.time.chrono.JapaneseChronology">JapaneseChronology</a> - Chronology.of(id)
 * <li><a href="../../../serialized-form.html#java.time.chrono.MinguoChronology">MinguoChronology</a> - Chronology.of(id)
 * <li><a href="../../../serialized-form.html#java.time.chrono.ThaiBuddhistChronology">ThaiBuddhistChronology</a> - Chronology.of(id)
 * <li><a href="../../../serialized-form.html#java.time.chrono.ChronoLocalDateTimeImpl">ChronoLocalDateTime</a> - date.atTime(time)
 * <li><a href="../../../serialized-form.html#java.time.chrono.ChronoZonedDateTimeImpl">ChronoZonedDateTime</a> - dateTime.atZone(offset).withZoneSameLocal(zone)
 * <li><a href="../../../serialized-form.html#java.time.chrono.JapaneseDate">JapaneseDate</a> - JapaneseChronology.INSTANCE.date(year, month, dayOfMonth)
 * <li><a href="../../../serialized-form.html#java.time.chrono.JapaneseEra">JapaneseEra</a> - JapaneseEra.of(eraValue)
 * <li><a href="../../../serialized-form.html#java.time.chrono.HijrahDate">HijrahDate</a> - HijrahChronology chrono.date(year, month, dayOfMonth)
 * <li><a href="../../../serialized-form.html#java.time.chrono.MinguoDate">MinguoDate</a> - MinguoChronology.INSTANCE.date(year, month, dayOfMonth)
 * <li><a href="../../../serialized-form.html#java.time.chrono.ThaiBuddhistDate">ThaiBuddhistDate</a> - ThaiBuddhistChronology.INSTANCE.date(year, month, dayOfMonth)
 * </ul>
 *
 * @param in  the data stream to read from, not null
 */
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    type = in.readByte();
    object = readInternal(type, in);
}