---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideTextReader - Scoped

# GlideTextReader - Scoped {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
The GlideTextReader API provides the ability to read single lines from an input stream. Because an input stream is used, it is not subject to the 5MB attachment size limit.

## GlideTextReader - GlideTextReader( GlideScriptableInputStream inputStream) {#ariaid-title2}

Creates a scoped GlideTextReader object for the specified input stream.
{#r_GTRS-GlideTextReader_GSIS__table_nlc_4dy_hx__entry__3}

| Name | Type | Description |
|-|-|-|
| inputStream | GlideScriptableInputStream | The input stream to be read. |
[Table 1. Parameters]

{#r_GTRS-GlideTextReader_GSIS__table_nlc_4dy_hx}

## GlideTextReader - getEncoding() {#ariaid-title3}

Returns the character encoding of the input stream.
{#r_GTRS-getEncoding__table_fdd_kgy_hx__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 2. Parameters]

{#r_GTRS-getEncoding__table_fdd_kgy_hx} {#r_GTRS-getEncoding__table_gdd_kgy_hx__entry__2}

| Type | Description |
|-|-|
| String | The character encoding of the input stream. |
[Table 3. Returns]

{#r_GTRS-getEncoding__table_gdd_kgy_hx}

## GlideTextReader - readLine() {#ariaid-title4}

Returns a single line from the input stream and returns a string. Since this is working
off of a stream, it is not subject to the 5MB size limit.
{#r_GTRS-readLine__table_d31_r2y_hx__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 4. Parameters]

{#r_GTRS-readLine__table_d31_r2y_hx} {#r_GTRS-readLine__table_e31_r2y_hx__entry__2}

| Type | Description |
|-|-|
| String | A single line of input up to the carriage return. Does not include the carriage return. Returns null if there is no content. |
[Table 5. Returns]

{#r_GTRS-readLine__table_e31_r2y_hx}  

    var is = new GlideSysAttachment().getContentStream(attachmentSysId);
    var reader = new GlideTextReader(is);
    var ln = ' ';
    while((ln = reader.readLine()) != null) {
      gs.info(ln);
    }


