Interface InStream

 1 /*
 2  * Copyright (c) 2016 Vivid Solutions.
 3  *
 4  * All rights reserved. This program and the accompanying materials
 5  * are made available under the terms of the Eclipse Public License 2.0
 6  * and Eclipse Distribution License v. 1.0 which accompanies this distribution.
 7  * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v20.html
 8  * and the Eclipse Distribution License is available at
 9  *
10  * http://www.eclipse.org/org/documents/edl-v10.php.
11  */
12 package org.locationtech.jts.io;
13  
14 import java.io.IOException;
15  
16 /**
17  * A interface for classes providing an input stream of bytes.
18  * This interface is similar to the Java <code>InputStream</code>,
19  * but with a narrower interface to make it easier to implement.
20  *
21  */
22 public interface InStream
23 {
24   /**
25    * Reads <code>buf.length</code> bytes from the input stream
26    * and stores them in the supplied buffer.
27    *
28    * @param buf the buffer to receive the bytes
29    *
30    * @throws IOException if an I/O error occurs
31    */
32   void read(byte[] buf) throws IOException;
33 }
34