- opennxserialization10.zip
- OpenNxSerialization.10
- Bin
- Benchmark.jar
- lib
- OpenNxSerialization.Core_1.0.0.0.jar
- OpenNxSerialization.Standard_1.0.0.0.jar
- README.TXT
- clean.bat
- Docs
- OpenNxSerialization.Core
- OpenNxSerialization.Standard
- Lib
- OpenNxSerialization.Core_1.0.0.0.jar
- OpenNxSerialization.Standard_1.0.0.0.jar
- License.rtf
- Readme.txt
- Samples
- Src
- clean.bat
- OpenNxSerialization.Core_1.0.0.0
- build.xml
- nbproject
- src
- com
- nextreme
- opennxserialization
- core
- test
- OpenNxSerialization.Standard_1.0.0.0
- build.xml
- nbproject
- src
- com
- nextreme
- opennxserialization
- standard
- test
|
/*
* @(#)NxLongSerializationSurrogate.java 1.0
*
* Created on September 18, 2008, 12:59 PM
*
* Copyright 2008 NeXtreme Innovations, Inc. All rights reserved.
* "NeXtreme Innovations" PROPRIETARY/CONFIDENTIAL. Use is subject
* to license terms.
*/
package com.nextreme.opennxserialization.standard.io.surrogates;
import com.nextreme.opennxserialization.core.io.NxObjectInput;
import com.nextreme.opennxserialization.core.io.NxObjectOutput;
import com.nextreme.opennxserialization.core.io.surrogates.NxBuiltinSerializationSurrogate;
import com.nextreme.opennxserialization.core.io.surrogates.NxIOException;
import com.nextreme.opennxserialization.core.io.surrogates.NxInstantiationException;
import com.nextreme.opennxserialization.core.io.surrogates.NxSerializationSurrogate;
import com.nextreme.opennxserialization.core.io.surrogates.NxSerializationSurrogateBase;
import java.io.IOException;
/**
* NxLongSerializationSurrogate is responsible for writing and reading
* instances of Long class.
*
* @version 1.0, September 18, 2008
*/
public class NxLongSerializationSurrogate
extends NxSerializationSurrogateBase
implements NxSerializationSurrogate, NxBuiltinSerializationSurrogate
{
/** Creates a new instance of NxLongSerializationSurrogate */
public NxLongSerializationSurrogate() {
super(Long.class);
}
/**
* Read and return an object. The class that implements this interface
* defines where the object is "read" from.
*
* @param input the stream to read data from in order to restore the object.
* @return the object read from the stream
* @exception java.lang.ClassNotFoundException If the class of a serialized
* object cannot be found.
* @exception IOException If any of the usual Input/Output
* related exceptions occur.
*/
public Object readObject(NxObjectInput input)
throws NxInstantiationException, NxIOException
{
try {
return input.readLong();
} catch (IOException ex) {
throw new NxIOException(ex);
}
}
/**
* Write an object to the underlying storage or stream. The
* class that implements this interface defines how the object is
* written.
*
* @param output the stream to write the object to.
* @param graph the object to write .
* @exception IOException Any of the usual Input/Output related exceptions.
*/
public void writeObject(NxObjectOutput output, Object graph)
throws NxIOException
{
try {
output.writeLong((Long)graph);
} catch (IOException ex) {
throw new NxIOException(ex);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Let a = b ....... (1)
a - b = a - b
a^2 - ab = a^2 - ab
a^2 - ab = a^2 - b^2 (from 1)
a (a - b) = (a + b) (a - b)
a = (a + b) ...... (2)
if a = 1
1 = (1 + 1) (from 1 & 2)
1 = 2 !!