{"record":{"id":"7c0cf01e2e9a6d5f","repo":"libgdx/libgdx","slug":"readline-nyi","errorCode":null,"errorMessage":"readline NYI","messagePattern":"readline NYI","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/io/DataInputStream.java","lineNumber":85,"sourceCode":"\t\t\tint count = is.read(b, off, len);\n\t\t\tif (count <= 0) {\n\t\t\t\tthrow new EOFException();\n\t\t\t}\n\t\t\toff += count;\n\t\t\tlen -= count;\n\t\t}\n\t}\n\n\tpublic int readInt () throws IOException {\n\t\tint a = is.read();\n\t\tint b = is.read();\n\t\tint c = is.read();\n\t\tint d = readUnsignedByte();\n\t\treturn (a << 24) | (b << 16) | (c << 8) | d;\n\t}\n\n\tpublic String readLine () throws IOException {\n\t\tthrow new RuntimeException(\"readline NYI\");\n\t}\n\n\tpublic long readLong () throws IOException {\n\t\tlong a = readInt();\n\t\tlong b = readInt();\n\t\treturn (a << 32) | (b & 0xffffffffL);\n\t}\n\n\tpublic short readShort () throws IOException {\n\t\tint a = is.read();\n\t\tint b = readUnsignedByte();\n\t\treturn (short)((a << 8) | b);\n\t}\n\n\tpublic String readUTF () throws IOException {\n\t\tint bytes = readUnsignedShort();\n\t\tStringBuilder sb = new StringBuilder();\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/libgdx/libgdx/blob/97f40861878058087be0685ca167ddfde132134b/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/java/io/DataInputStream.java#L67-L103","documentation":"DataInputStream.readLine() in the GWT java.io emulator is explicitly not implemented and always throws RuntimeException(\"readline NYI\"). The emulator only implements the binary read methods (readInt, readShort, readUTF, etc.); text-line reading was never ported because GWT has no blocking console/file stream model.","triggerScenarios":"Calling readLine() on a DataInputStream (or code that does, e.g. OBJ/CSV loaders, hand-rolled readers) anywhere in a GWT/html5 libGDX build. Also hit transitively when a library shared with desktop uses DataInputStream.readLine().","commonSituations":"Reusing a desktop file parser that mixes binary reads and readLine() and running it with GWTFile/asset streams on the html5 backend. Fails immediately at the first line read, both in SuperDevMode and compiled output.","solutions":["Replace readLine() usage with BufferedReader.readLine() over an InputStreamReader on the asset stream, which the emulator supports.","Reimplement line parsing manually: read bytes until '\\n' via read() and build the String.","Isolate the binary+text parser in a non-GWT source set and provide a GWT-specific reader.","If a third-party library hits this, check for a GWT-compatible version or exclude that code path on html5."],"exampleFix":"// before\nDataInputStream in = new DataInputStream(file.read());\nString line = in.readLine();\n\n// after\nBufferedReader reader = new BufferedReader(new InputStreamReader(file.read()));\nString line = reader.readLine();","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never call DataInputStream.readLine() in GWT-compiled code; it always throws.","Use BufferedReader.readLine over InputStreamReader for text.","Audit shared parsers for readLine-on-DataInputStream before adding them to the GWT module."],"tags":["gwt","io","datainputstream","nyi","libgdx"],"backgroundTag":null,"analyzedSha":"97f40861878058087be0685ca167ddfde132134b","analyzedAt":"2026-08-14T10:52:53.492Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}