Path: blob/main/src/lwjgl/java/javazoom/jl/decoder/InputStreamSource.java
8650 views
/*1* 11/19/04 1.0 moved to LGPL.2* 12/12/99 Initial version. [email protected]3*-----------------------------------------------------------------------4* This program is free software; you can redistribute it and/or modify5* it under the terms of the GNU Library General Public License as published6* by the Free Software Foundation; either version 2 of the License, or7* (at your option) any later version.8*9* This program is distributed in the hope that it will be useful,10* but WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12* GNU Library General Public License for more details.13*14* You should have received a copy of the GNU Library General Public15* License along with this program; if not, write to the Free Software16* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.17*----------------------------------------------------------------------18*/1920package javazoom.jl.decoder;2122import java.io.IOException;23import java.io.InputStream;2425/**26* <i>Work In Progress.</i>27*28* An instance of <code>InputStreamSource</code> implements a29* <code>Source</code> that provides data from an <code>InputStream30* </code>. Seeking functionality is not supported.31*32* @author MDM33*/34public class InputStreamSource implements Source35{36private final InputStream in;3738public InputStreamSource(InputStream in)39{40if (in==null)41throw new NullPointerException("in");4243this.in = in;44}4546public int read(byte[] b, int offs, int len)47throws IOException48{49int read = in.read(b, offs, len);50return read;51}5253public boolean willReadBlock()54{55return true;56//boolean block = (in.available()==0);57//return block;58}5960public boolean isSeekable()61{62return false;63}6465public long tell()66{67return -1;68}6970public long seek(long to)71{72return -1;73}7475public long length()76{77return -1;78}79}808182