@Test public void readArrayNodeRequiresArray() { assertThrows(IOException.class, () -> Json.readArrayNode(new byte[] {})); assertThrows(IOException.class, () -> Json.readArrayNode("{}".getBytes(StandardCharsets.UTF_8))); }
public static ArrayNode readArrayNode(byte[] data) throws IOException { TreeNode root = MAPPER.readTree(data); if (!root.isArray()) { throw new IOException("json value is not an array"); } return (ArrayNode) root; }
Json { public static ArrayNode readArrayNode(byte[] data) throws IOException { TreeNode root = MAPPER.readTree(data); if (!root.isArray()) { throw new IOException("json value is not an array"); } return (ArrayNode) root; } }
Json { public static ArrayNode readArrayNode(byte[] data) throws IOException { TreeNode root = MAPPER.readTree(data); if (!root.isArray()) { throw new IOException("json value is not an array"); } return (ArrayNode) root; }  }
Json { public static ArrayNode readArrayNode(byte[] data) throws IOException { TreeNode root = MAPPER.readTree(data); if (!root.isArray()) { throw new IOException("json value is not an array"); } return (ArrayNode) root; }  static String asString(JsonNode data); static String asString(Object data); static byte[] asBytes(JsonNode data); static byte[] asBytes(Object data); static ObjectNode asObjectNode(Map<String, ?> map); static Map<String, Object> asMap(ObjectNode objectNode); static T convertValue(TreeNode root, Class<T> klass); @VisibleForTesting static T convertValue(TreeNode root, TypeReference<T> typeReference); static Schema readBigQuerySchema(byte[] data); static T readValue(byte[] data, Class<T> klass); static ObjectNode readObjectNode(byte[] data); static ObjectNode readObjectNode(String data); static ArrayNode readArrayNode(byte[] data); static Map<String, Object> readMap(String data); static ObjectNode createObjectNode(); static ArrayNode createArrayNode(); static boolean isNullOrEmpty(ObjectNode node); static boolean isNullOrEmpty(JsonNode node); }
Json { public static ArrayNode readArrayNode(byte[] data) throws IOException { TreeNode root = MAPPER.readTree(data); if (!root.isArray()) { throw new IOException("json value is not an array"); } return (ArrayNode) root; }  static String asString(JsonNode data); static String asString(Object data); static byte[] asBytes(JsonNode data); static byte[] asBytes(Object data); static ObjectNode asObjectNode(Map<String, ?> map); static Map<String, Object> asMap(ObjectNode objectNode); static T convertValue(TreeNode root, Class<T> klass); @VisibleForTesting static T convertValue(TreeNode root, TypeReference<T> typeReference); static Schema readBigQuerySchema(byte[] data); static T readValue(byte[] data, Class<T> klass); static ObjectNode readObjectNode(byte[] data); static ObjectNode readObjectNode(String data); static ArrayNode readArrayNode(byte[] data); static Map<String, Object> readMap(String data); static ObjectNode createObjectNode(); static ArrayNode createArrayNode(); static boolean isNullOrEmpty(ObjectNode node); static boolean isNullOrEmpty(JsonNode node);  }