Interface ArrayReader

All Known Implementing Classes:
JacksonReader

@ThreadSafe public interface ArrayReader
Reads Array instances from a variety of input forms.
Author:
Randall Hauch
  • Method Details

    • defaultReader

      static ArrayReader defaultReader()
      Get the default ArrayReader instance.
      Returns:
      the shared default reader instance; never null
    • readArray

      Array readArray(InputStream jsonStream) throws IOException
      Read an array from the supplied stream.
      Parameters:
      jsonStream - the input stream to be read; may not be null
      Returns:
      the array instance; never null
      Throws:
      IOException - if an array could not be read from the supplied stream
    • readArray

      Array readArray(Reader jsonReader) throws IOException
      Read an array from the supplied Reader.
      Parameters:
      jsonReader - the reader to be read; may not be null
      Returns:
      the array instance; never null
      Throws:
      IOException - if an array could not be read from the supplied reader
    • readArray

      Array readArray(String json) throws IOException
      Read an array from the supplied JSON-formatted string.
      Parameters:
      json - the JSON string representation to be read; may not be null
      Returns:
      the array instance; never null
      Throws:
      IOException - if an array could not be read from the supplied string
    • readArray

      default Array readArray(URL jsonUrl) throws IOException
      Read an array from the content at the given URL.
      Parameters:
      jsonUrl - the URL to the content that is to be read; may not be null
      Returns:
      the array instance; never null
      Throws:
      IOException - if an array could not be read from the supplied content
    • readArray

      default Array readArray(File jsonFile) throws IOException
      Read an array from the supplied file.
      Parameters:
      jsonFile - the file to be read; may not be null
      Returns:
      the array instance; never null
      Throws:
      IOException - if an array could not be read from the supplied file
    • readArray

      default Array readArray(byte[] rawBytes) throws IOException
      Read an array from the supplied bytes.
      Parameters:
      rawBytes - the UTF-8 bytes to be read; may not be null
      Returns:
      the array instance; never null
      Throws:
      IOException - if an array could not be read from the supplied bytes