本文整理汇总了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();
}
示例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();
}
示例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;
}
}
示例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
);
}
示例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();
}
示例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();
}
示例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){
}
}
示例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);
}
}
示例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);
}
}
}
示例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();
}
}
示例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);
}
}
示例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();
}
示例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();
}
}
示例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;
}
}
示例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;
}