Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zaki50/853826 to your computer and use it in GitHub Desktop.
Save zaki50/853826 to your computer and use it in GitHub Desktop.
コマンドの長さが127を超えると例外がスローされるので修正
Index: src/net/kazzz/felica/lib/FeliCaLib.java
===================================================================
--- src/net/kazzz/felica/lib/FeliCaLib.java (リビジョン 37)
+++ src/net/kazzz/felica/lib/FeliCaLib.java (作業コピー)
@@ -256,7 +256,7 @@
* @return byte[] このデータのバイト列表現を戻します
*/
public byte[] getBytes() {
- ByteBuffer buff = ByteBuffer.allocate(this.length);
+ ByteBuffer buff = ByteBuffer.allocate(this.length & 0xFF);
if ( this.idm != null ) {
buff.put(this.length).put(this.commandCode).put(this.idm.getBytes()).put(this.data);
} else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment