Added new constants

Add new constants in Constants.java

All single ints int FlatBufferBuilder.java were replaced by constants
from Constants.java
This commit is contained in:
Yury Bandarchuk
2016-06-23 19:51:55 +04:00
parent 2fdafa9a49
commit c97abb1eea
2 changed files with 22 additions and 14 deletions

View File

@@ -23,10 +23,18 @@ package com.google.flatbuffers;
*/
public class Constants {
// Java doesn't seem to have these.
/** The number of bytes in an `byte`. */
static final int SIZEOF_BYTE = 1;
/** The number of bytes in a `short`. */
static final int SIZEOF_SHORT = 2;
/** The number of bytes in an `int`. */
static final int SIZEOF_INT = 4;
/** The number of bytes in an `float`. */
static final int SIZEOF_FLOAT = 4;
/** The number of bytes in an `long`. */
static final int SIZEOF_LONG = 8;
/** The number of bytes in an `double`. */
static final int SIZEOF_DOUBLE = 4;
/** The number of bytes in a file identifier. */
static final int FILE_IDENTIFIER_LENGTH = 4;
}