This repository has been archived by the owner on May 3, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de1fc16
commit 66aa9d6
Showing
9 changed files
with
87 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/org/dragonet/entity/metadata/type/LongMeta.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* GNU LESSER GENERAL PUBLIC LICENSE | ||
* Version 3, 29 June 2007 | ||
* | ||
* Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | ||
* Everyone is permitted to copy and distribute verbatim copies | ||
* of this license document, but changing it is not allowed. | ||
* | ||
* You can view LICENCE file for details. | ||
* | ||
* @author The Dragonet Team | ||
*/ | ||
package org.dragonet.entity.metadata.type; | ||
|
||
import java.nio.ByteBuffer; | ||
import java.nio.ByteOrder; | ||
import org.dragonet.entity.metadata.EntityMetaData; | ||
import org.dragonet.entity.metadata.EntityMetaDataObject; | ||
|
||
public class LongMeta implements EntityMetaDataObject { | ||
|
||
public long data; | ||
|
||
public LongMeta(long data) { | ||
this.data = data; | ||
} | ||
|
||
@Override | ||
public int type() { | ||
return EntityMetaData.Constants.DATA_TYPE_LONG; | ||
} | ||
|
||
@Override | ||
public byte[] encode() { | ||
ByteBuffer buff = ByteBuffer.allocate(8); | ||
buff.order(ByteOrder.LITTLE_ENDIAN); | ||
buff.putLong(this.data); | ||
return buff.array(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters