⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post.java

📁 Mofire的JAR压缩包
💻 JAVA
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   Post.java

package com.modofo.mofire;

import java.io.*;

// Referenced classes of package com.modofo.mofire:
//			Storable

public class Post
	implements Storable
{

	private String title;
	private String content;
	private String category;
	private int id;

	public Post()
	{
		title = "";
		content = "";
		category = "";
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public String getTitle()
	{
		return title;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}

	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public String getCategory()
	{
		return category;
	}

	public void setCategory(String category)
	{
		this.category = category;
	}

	public String toString()
	{
		return id + ";" + title + ";" + content;
	}

	public byte[] toByteArray()
	{
		ByteArrayOutputStream baos;
		DataOutputStream os;
		baos = new ByteArrayOutputStream();
		os = new DataOutputStream(baos);
		os.writeInt(id);
		os.writeUTF(title);
		os.writeUTF(content);
		os.writeUTF(category);
		os.flush();
		os.close();
		return baos.toByteArray();
		Exception e;
		e;
		e.printStackTrace();
		return new byte[0];
	}

	public boolean fromByteArray(byte data[])
	{
		try
		{
			DataInputStream is = new DataInputStream(new ByteArrayInputStream(data));
			id = is.readInt();
			title = is.readUTF();
			content = is.readUTF();
			category = is.readUTF();
		}
		catch (Exception e)
		{
			e.printStackTrace();
			return false;
		}
		return true;
	}
}

⌨️ 快捷键说明

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