data.java

来自「数据库实现的一个源码包」· Java 代码 · 共 42 行

JAVA
42
字号
package neustore.base;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

/**
 * Interface for the data part of a record.
 * @see Key
 * @author Tian Xia &lt;tianxia@ccs.neu.edu&gt;<br>Donghui Zhang &lt;donghui@ccs.neu.edu&gt;
 */
public interface Data{
	/**
	 * Creates a new copy of the object.
	 * @return  the new copy
	 */
	public abstract Object clone();
	/* 
	 * Returns the number of bytes the object occupy.
	 * @return  number of bytes
	 */
	public abstract int size();
	/**
	 * Returns the maximum number of bytes this type of object may occupy.
	 * It is used to support variable-length data.
	 * @return  maximum number of bytes
	 */
	public abstract int maxSize();
	/**
	 * Reads the object from an input stream.
	 * @param in   input stream
	 * @throws IOException
	 */
	public abstract void read(DataInputStream in) throws IOException ;
	/**
	 * Writes the object to an output stream.
	 * @param out   output stream
	 * @throws IOException
	 */
	public abstract void write(DataOutputStream out) throws IOException ;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?