diff --git a/README.md b/README.md index fc37d69..7234fc0 100644 --- a/README.md +++ b/README.md @@ -252,8 +252,8 @@ for comments. "doubleArray": double ( 42.5D, -20D, 400D, NaND, -InfinityD, InfinityD, - 5.3e-200F, 4e+500F, 2.2e200F, - ) + 5.3e-200D, 4e+120D, 2.2e200D, + ), /* Arrays are enclosed by an opening diff --git a/src/bdf/types/BdfObject.java b/src/bdf/types/BdfObject.java index 57fcd43..e8770e8 100644 --- a/src/bdf/types/BdfObject.java +++ b/src/bdf/types/BdfObject.java @@ -240,7 +240,7 @@ public class BdfObject implements IBdfType if(ptr.isNext("true")) { if(type != BdfTypes.ARRAY_BOOLEAN) { - throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr); + throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr.getPointer(-4)); } boolean[] a = (boolean[]) array; @@ -250,7 +250,7 @@ public class BdfObject implements IBdfType else if(ptr.isNext("false")) { if(type != BdfTypes.ARRAY_BOOLEAN) { - throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr); + throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr.getPointer(-5)); } boolean[] a = (boolean[]) array; @@ -260,7 +260,7 @@ public class BdfObject implements IBdfType else if(ptr.isNext("infinityd")) { if(type != BdfTypes.ARRAY_DOUBLE) { - throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr); + throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr.getPointer(-9)); } double[] a = (double[]) array; @@ -270,7 +270,7 @@ public class BdfObject implements IBdfType else if(ptr.isNext("-infinityd")) { if(type != BdfTypes.ARRAY_DOUBLE) { - throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr); + throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr.getPointer(-10)); } double[] a = (double[]) array; @@ -280,7 +280,7 @@ public class BdfObject implements IBdfType else if(ptr.isNext("nand")) { if(type != BdfTypes.ARRAY_DOUBLE) { - throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr); + throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr.getPointer(-4)); } double[] a = (double[]) array; @@ -290,7 +290,7 @@ public class BdfObject implements IBdfType else if(ptr.isNext("infinityf")) { if(type != BdfTypes.ARRAY_FLOAT) { - throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr); + throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr.getPointer(-9)); } float[] a = (float[]) array; @@ -300,7 +300,7 @@ public class BdfObject implements IBdfType else if(ptr.isNext("-infinityf")) { if(type != BdfTypes.ARRAY_FLOAT) { - throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr); + throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr.getPointer(-10)); } float[] a = (float[]) array; @@ -310,7 +310,7 @@ public class BdfObject implements IBdfType else if(ptr.isNext("nanf")) { if(type != BdfTypes.ARRAY_FLOAT) { - throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr); + throw BdfError.createError(BdfError.ERROR_SYNTAX, ptr.getPointer(-4)); } float[] a = (float[]) array; diff --git a/src/tests/Tests.java b/src/tests/Tests.java index 098ef5d..ab711f0 100755 --- a/src/tests/Tests.java +++ b/src/tests/Tests.java @@ -5,6 +5,7 @@ import java.io.IOException; import bdf.data.IBdfDatabase; import bdf.types.BdfReader; +import bdf.types.BdfReaderHuman; public class Tests { @@ -29,28 +30,7 @@ public class Tests public static void main(String[] args) throws IOException { - @SuppressWarnings("resource") - FileInputStream rand = new FileInputStream("/dev/urandom"); - byte[] buffer = new byte[100]; - - long start = System.currentTimeMillis(); - long done = 0; - int i = 0; - - for(;;) - { - if(System.currentTimeMillis() - start > 1000) { - System.out.println("" + i + ": " + done); - start += 1000; - done = 0; - i += 1; - } - - done += 1; - - rand.read(buffer); - new BdfReader(buffer); - } + new BdfReaderHuman("int(NaND)"); } }