public static Type getType(int code) { for (Type type : Type.values()) { if (type.code == code) { return type; } } return null; } }
/** * Reads a type byte and returns the corresponding {@link Type}. * * @return the obtained Type or null when the end of the file is reached * @throws IOException */ public Type readType() throws IOException { int code = -1; try { code = in.readUnsignedByte(); } catch (EOFException eof) { return null; } for (Type type : Type.values()) { if (type.code == code) { return type; } } return null; }
/** Get the type code embedded in the first byte. */ public Type getType() { byte[] bytes = getBytes(); if (bytes == null || bytes.length == 0) { return null; } for (Type type : Type.values()) { if (type.code == bytes[0]) { return type; } } return null; }
public static Type getType(int code) { for (Type type : Type.values()) { if (type.code == code) { return type; } } return null; } }
public static Type getType(int code) { for (Type type : Type.values()) { if (type.code == code) { return type; } } return null; } }
public static Type getType(int code) { for (Type type : Type.values()) { if (type.code == code) { return type; } } return null; } }
public static Type getType(int code) { for (Type type : Type.values()) { if (type.code == code) { return type; } } return null; } }
/** * Reads a type byte and returns the corresponding {@link Type}. * * @return the obtained Type or null when the end of the file is reached * @throws IOException */ public Type readType() throws IOException { int code = -1; try { code = in.readUnsignedByte(); } catch (EOFException eof) { return null; } for (Type type : Type.values()) { if (type.code == code) { return type; } } return null; }
/** * Reads a type byte and returns the corresponding {@link Type}. * * @return the obtained Type or null when the end of the file is reached * @throws IOException */ public Type readType() throws IOException { int code = -1; try { code = in.readUnsignedByte(); } catch (EOFException eof) { return null; } for (Type type : Type.values()) { if (type.code == code) { return type; } } return null; }
/** * Reads a type byte and returns the corresponding {@link Type}. * * @return the obtained Type or null when the end of the file is reached * @throws IOException */ public Type readType() throws IOException { int code = -1; try { code = in.readUnsignedByte(); } catch (EOFException eof) { return null; } for (Type type : Type.values()) { if (type.code == code) { return type; } } return null; }
/** * Reads a type byte and returns the corresponding {@link Type}. * * @return the obtained Type or null when the end of the file is reached * @throws IOException */ public Type readType() throws IOException { int code = -1; try { code = in.readUnsignedByte(); } catch (EOFException eof) { return null; } for (Type type : Type.values()) { if (type.code == code) { return type; } } return null; }
/** Get the type code embedded in the first byte. */ public Type getType() { byte[] bytes = get(); if (bytes == null || bytes.length == 0) { return null; } for (Type type : Type.values()) { if (type.code == bytes[0]) { return type; } } return null; }
/** Get the type code embedded in the first byte. */ public Type getType() { byte[] bytes = getBytes(); if (bytes == null || bytes.length == 0) { return null; } for (Type type : Type.values()) { if (type.code == bytes[0]) { return type; } } return null; }
/** Get the type code embedded in the first byte. */ public Type getType() { byte[] bytes = getBytes(); if (bytes == null || bytes.length == 0) { return null; } for (Type type : Type.values()) { if (type.code == bytes[0]) { return type; } } return null; }
/** Get the type code embedded in the first byte. */ public Type getType() { byte[] bytes = getBytes(); if (bytes == null || bytes.length == 0) { return null; } for (Type type : Type.values()) { if (type.code == bytes[0]) { return type; } } return null; }