當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectInputStream.readBoolean方法代碼示例

本文整理匯總了Java中java.io.ObjectInputStream.readBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java ObjectInputStream.readBoolean方法的具體用法?Java ObjectInputStream.readBoolean怎麽用?Java ObjectInputStream.readBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.io.ObjectInputStream的用法示例。


在下文中一共展示了ObjectInputStream.readBoolean方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
    String name = (String) in.readObject();
    String value = (String) in.readObject();
    long expiresAt = in.readLong();
    String domain = (String) in.readObject();
    String path = (String) in.readObject();
    boolean secure = in.readBoolean();
    boolean httpOnly = in.readBoolean();
    boolean hostOnly = in.readBoolean();
    boolean persistent = in.readBoolean();
    Cookie.Builder builder = new Cookie.Builder();
    builder = builder.name(name);
    builder = builder.value(value);
    builder = builder.expiresAt(expiresAt);
    builder = hostOnly ? builder.hostOnlyDomain(domain) : builder.domain(domain);
    builder = builder.path(path);
    builder = secure ? builder.secure() : builder;
    builder = httpOnly ? builder.httpOnly() : builder;
    clientCookie = builder.build();

}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:23,代碼來源:SerializableHttpCookie.java

示例2: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
private void readObject(ObjectInputStream in)
    throws IOException, ClassNotFoundException
{
    z = in.readBoolean();
    b = in.readByte();
    c = in.readChar();
    s = in.readShort();
    i = in.readInt();
    f = in.readFloat();
    j = in.readLong();
    d = in.readDouble();
    str = (String) in.readObject();
    parent = in.readObject();
    left = in.readObject();
    right = in.readObject();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:17,代碼來源:CustomObjTrees.java

示例3: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
void readObject(ObjectInputStream in) throws IOException {
    instrType = in.readInt();

    int len = in.readInt();
    classNames = new String[len];

    for (int i = 0; i < len; i++) {
        classNames[i] = in.readUTF().intern(); // Interning is important, since checks are through '=='
    }

    instrSpawnedThreads = in.readBoolean();
    startProfilingPointsActive = in.readBoolean();

    try {
        profilingPointIDs = (int[]) in.readObject();
        profilingPointHandlers = (String[]) in.readObject();
        profilingPointInfos = (String[]) in.readObject();
    } catch (ClassNotFoundException e) {
        IOException ioe = new IOException();
        ioe.initCause(e);
        throw ioe;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:InitiateProfilingCommand.java

示例4: deserialize

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 * Custom deserialization routine used during deserialization of a
 * Session/PersistenceContext for increased performance.
 *
 * @param ois The stream from which to read the entry.
 * @param persistenceContext The context being deserialized.
 *
 * @return The deserialized EntityEntry
 *
 * @throws IOException If a stream error occurs
 * @throws ClassNotFoundException If any of the classes declared in the stream
 * cannot be found
 */
public static EntityEntry deserialize(
		ObjectInputStream ois,
		PersistenceContext persistenceContext) throws IOException, ClassNotFoundException {
	String previousStatusString;
	return new EntityEntry(
			persistenceContext.getSession().getFactory(),
			(String) ois.readObject(),
			(Serializable) ois.readObject(),
			Status.valueOf( (String) ois.readObject() ),
			( previousStatusString = (String) ois.readObject() ).length() == 0
					? null
					: Status.valueOf( previousStatusString ),
			(Object[]) ois.readObject(),
			(Object[]) ois.readObject(),
			ois.readObject(),
			LockMode.valueOf( (String) ois.readObject() ),
			ois.readBoolean(),
			ois.readBoolean(),
			ois.readBoolean(),
			persistenceContext
	);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:36,代碼來源:EntityEntry.java

示例5: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    String name = (String) in.readObject();
    String value = (String) in.readObject();
    long expiresAt = in.readLong();
    String domain = (String) in.readObject();
    String path = (String) in.readObject();
    boolean secure = in.readBoolean();
    boolean httpOnly = in.readBoolean();
    boolean hostOnly = in.readBoolean();
    boolean persistent = in.readBoolean();
    Cookie.Builder builder = new Cookie.Builder();
    builder = builder.name(name);
    builder = builder.value(value);
    builder = builder.expiresAt(expiresAt);
    builder = hostOnly ? builder.hostOnlyDomain(domain) : builder.domain(domain);
    builder = builder.path(path);
    builder = secure ? builder.secure() : builder;
    builder = httpOnly ? builder.httpOnly() : builder;
    clientCookie = builder.build();

}
 
開發者ID:fodroid,項目名稱:XDroid-Databinding,代碼行數:22,代碼來源:SerializableHttpCookie.java

示例6: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 *  Overrides the default readObject implementation since we decided
 *  it would be cleaner not to serialize the entire tranformer
 *  factory.  [ ref bugzilla 12317 ]
 *  We need to check if the user defined class for URIResolver also
 *  implemented Serializable
 *  if yes then we need to deserialize the URIResolver
 *  Fix for bugzilla bug 22438
 */
@SuppressWarnings("unchecked")
private void  readObject(ObjectInputStream is)
  throws IOException, ClassNotFoundException
{
    SecurityManager security = System.getSecurityManager();
    if (security != null){
        String temp = SecuritySupport.getSystemProperty(DESERIALIZE_TRANSLET);
        if (temp == null || !(temp.length()==0 || temp.equalsIgnoreCase("true"))) {
            ErrorMsg err = new ErrorMsg(ErrorMsg.DESERIALIZE_TRANSLET_ERR);
            throw new UnsupportedOperationException(err.toString());
        }
    }

    // We have to read serialized fields first.
    ObjectInputStream.GetField gf = is.readFields();
    _name = (String)gf.get("_name", null);
    _bytecodes = (byte[][])gf.get("_bytecodes", null);
    _class = (Class[])gf.get("_class", null);
    _transletIndex = gf.get("_transletIndex", -1);

    _outputProperties = (Properties)gf.get("_outputProperties", null);
    _indentNumber = gf.get("_indentNumber", 0);

    if (is.readBoolean()) {
        _uriResolver = (URIResolver) is.readObject();
    }

    _tfactory = new TransformerFactoryImpl();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:39,代碼來源:TemplatesImpl.java

示例7: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException{
	tokenizerMethod = (TokenizerMethod)ois.readObject();
	brownMap = (Map<String, String>)ois.readObject();
	for(FeatureType featureType: FeatureType.values()){
		featureType.isEnabled = ois.readBoolean();
	}
	try{
		prefixLength = ois.readInt();
		suffixLength = ois.readInt();
	} catch (Exception e){
		
	}
}
 
開發者ID:justhalf,項目名稱:weak-semi-crf-naacl2016,代碼行數:15,代碼來源:WordWeakSemiCRFFeatureManager.java

示例8: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 * Deserialize the {@code CertificateRevokedException} instance.
 */
private void readObject(ObjectInputStream ois)
    throws IOException, ClassNotFoundException {
    // Read in the non-transient fields
    // (revocationDate, reason, authority)
    ois.defaultReadObject();

    // Defensively copy the revocation date
    revocationDate = new Date(revocationDate.getTime());

    // Read in the size (number of mappings) of the extensions map
    // and create the extensions map
    int size = ois.readInt();
    if (size == 0) {
        extensions = Collections.emptyMap();
    } else {
        extensions = new HashMap<>(size);
    }

    // Read in the extensions and put the mappings in the extensions map
    for (int i = 0; i < size; i++) {
        String oid = (String) ois.readObject();
        boolean critical = ois.readBoolean();
        int length = ois.readInt();
        byte[] extVal = new byte[length];
        ois.readFully(extVal);
        Extension ext = sun.security.x509.Extension.newExtension
            (new ObjectIdentifier(oid), critical, extVal);
        extensions.put(oid, ext);
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:34,代碼來源:CertificateRevokedException.java

示例9: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
void readObject(ObjectInputStream in) throws IOException {
    jdk15 = in.readBoolean();
    long t = in.readLong();
    time = new Date(t);
    int len = in.readInt();
    cdThreads = new Object[len];
    for (int i = 0; i < len; i++) {
        try {
            cdThreads[i] = in.readObject();
        } catch (ClassNotFoundException ex) {
            throw new IOException(ex);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:ThreadDumpResponse.java

示例10: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
private void readObject(ObjectInputStream in) throws IOException,
        ClassNotFoundException {
    in.defaultReadObject();
    boolean hasPrincipal = in.readBoolean();
    if (hasPrincipal) {
        principal = (Principal) in.readObject();
    }
}
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:9,代碼來源:SingleSignOnEntry.java

示例11: read

import java.io.ObjectInputStream; //導入方法依賴的package包/類
@Override
public final void read(ObjectInputStream is, int count) throws IOException {
    for (int i=0; i<count; ++i) {
        final boolean value = is.readBoolean();
        this.setBoolean(i, value);
    }
}
 
開發者ID:zavtech,項目名稱:morpheus-core,代碼行數:8,代碼來源:MappedArrayOfBooleans.java

示例12: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
private void readObject(
    ObjectInputStream in)
    throws IOException, ClassNotFoundException
{
    byte[] enc = (byte[])in.readObject();

    populateFromPubKeyInfo(SubjectPublicKeyInfo.getInstance(ASN1Primitive.fromByteArray(enc)));

    this.algorithm = (String)in.readObject();
    this.withCompression = in.readBoolean();
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:12,代碼來源:JCEECPublicKey.java

示例13: readObject

import java.io.ObjectInputStream; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException{
	tokenizerMethod = (TokenizerMethod)ois.readObject();
	brownMap = (Map<String, String>)ois.readObject();
	wordHalfWindowSize = ois.readInt();
	prefixLength = ois.readInt();
	suffixLength = ois.readInt();
	wordOnlyLeftWindow = ois.readBoolean();
	for(FeatureType featureType: FeatureType.values()){
		featureType.isEnabled = ois.readBoolean();
	}
}
 
開發者ID:justhalf,項目名稱:weak-semi-crf-naacl2016,代碼行數:13,代碼來源:LinearCRFFeatureManager.java

示例14: restoreState

import java.io.ObjectInputStream; //導入方法依賴的package包/類
public synchronized boolean restoreState() {
	try {
		ObjectInputStream in = new ObjectInputStream(new FileInputStream(statefile));
		String u = in.readUTF();
		if (!(url == null || url.length() < 1)) {
			u = url;
		}
		setUrl(u);
		creditential = (Credential) in.readObject();
		fileName = in.readUTF();
		String finalFileName2 = in.readUTF();
		if (finalFileName == null) {
			finalFileName = finalFileName2;
		}
		String destdir2 = in.readUTF();
		if (destdir == null)
			setDestdir(destdir2);
		length = in.readLong();
		downloaded = in.readLong();
		int sz = in.readInt();
		fileList = new ArrayList<ChunkFileInfo>();
		for (int i = 0; i < sz; i++) {
			fileList.add((ChunkFileInfo) in.readObject());
		}
		sz = in.readInt();
		list = new ArrayList<Connection>();
		for (int i = 0; i < sz; i++) {
			Connection.State state = (Connection.State) in.readObject();
			state.url = url;
			if (url.startsWith("http"))
				list.add(new HttpConnection(state, timeout, this, lock, creditential, config));
			else
				list.add(new FTPConnection(state, timeout, this, lock, creditential, config));
		}
		prevdownload = in.readLong();
		overwrite = in.readBoolean();
		in.close();
		return true;
	} catch (Exception e) {
		e.printStackTrace();
		System.out.println(e.getMessage());
		return false;
	}
}
 
開發者ID:kmarius,項目名稱:xdman,代碼行數:45,代碼來源:ConnectionManager.java

示例15: deserialize

import java.io.ObjectInputStream; //導入方法依賴的package包/類
/**
 * JDK serialization hook for deserializing
 *
 * @param ois The stream to read ourselves from
 * @param rtn The persistence context we belong to
 *
 * @return The deserialized EntityEntryContext
 *
 * @throws IOException Indicates an IO exception accessing the given stream
 * @throws ClassNotFoundException Problem reading stream data
 */
public static EntityEntryContext deserialize(ObjectInputStream ois, StatefulPersistenceContext rtn)
		throws IOException, ClassNotFoundException {
	final int count = ois.readInt();
	log.tracef( "Starting deserialization of [%s] EntityEntry entries", count );

	final EntityEntryContext context = new EntityEntryContext();
	context.count = count;
	context.dirty = true;

	if ( count == 0 ) {
		return context;
	}

	ManagedEntity previous = null;

	for ( int i = 0; i < count; i++ ) {
		final boolean isEnhanced = ois.readBoolean();
		final Object entity = ois.readObject();
		final EntityEntry entry = EntityEntry.deserialize( ois, rtn );
		final ManagedEntity managedEntity;
		if ( isEnhanced ) {
			managedEntity = (ManagedEntity) entity;
		}
		else {
			managedEntity = new ManagedEntityImpl( entity );
			if ( context.nonEnhancedEntityXref == null ) {
				context.nonEnhancedEntityXref = new IdentityHashMap<Object, ManagedEntity>();
			}
			context.nonEnhancedEntityXref.put( entity, managedEntity );
		}
		managedEntity.$$_hibernate_setEntityEntry( entry );

		if ( previous == null ) {
			context.head = managedEntity;
		}
		else {
			previous.$$_hibernate_setNextManagedEntity( managedEntity );
			managedEntity.$$_hibernate_setPreviousManagedEntity( previous );
		}

		previous = managedEntity;
	}

	context.tail = previous;

	return context;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:59,代碼來源:EntityEntryContext.java


注:本文中的java.io.ObjectInputStream.readBoolean方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。